Well, based off context... Your Block class extends Rectangle. Engine.sY is a static variable that should looks like it should never have a null value. Also, in your Block class, when you call y and height, you haven't given any values to those variables. When the code executes, y and height remain null until tick is called.

I don't know much about Rectangle, but I'm going to guess that x, y, and height are called like this:

I am a newb trying to follow a video :( It all works for him and now this and I don't understand any of it!!!

The guy said that we need to do that because If we don't it won't work and I tried it and it doesn't and his definition of static was changable and then everyone here says it causes problems and I DON'T GET!

Find in the code where the image is being drawn. Print out the values used by the drawImage method that controls the height of the image. When you find the value/variable that is making the image get shorter, then backtrack in the code to find out why the values of the variables are changing to make the image shorter.

Quote:

I don't understand any of it!!!

The code has no comments describing what it is doing or how the different pieces fit together. Can you ask the author for some documentation for the program that explains what it does?

My advice, follow a different video. Static means that a variable can be accessed (changing is a form of accessing) by simply evoking the class name.

Code java:

//for exampleMath.PI;// is a public static final double value in the Math class that is an approximation of Pi.

The fact that I couldn't even get the program to run the way you gave is a HUGE red flag. He even got the main method wrong.

Code java:

//standard main methodpublicstaticvoid main(String[] args){//code}//hispublicstaticvoid main(String args[]){//which doesn't really work because the value would be the ID of the array}

Frankly, if you want to continue with this program, you're going to be frustrated and confused for a long time, at least until you somewhat understand what's going on. Learn the basics of Java then move into GUI's and more advanced algorithms. We will help you if you want to debug this program, the decision is yours.

It's just how to do a game. I learn by following these tutorials over and over and eventually I understand it all and pick up some good concepts. But this is just all going to heck :( I moved on, we added collision but after the player stops, the camera keeps going. But the variable for the camera\'s Y isn\'t being messed with anywhere other than where the player\'s y is. Do not get.

Stuff like this really down\'s on my courage to keep up this whole \'Learning Java\' :/

Don\'t be discouraged. It takes a long time to learn. There are different ways to learn than through videos. projecteuler.net is a great programming challenge website. Java works well for most of the problem. I\'ve learned a lot about elegant programming, arrays, and math just by solving a few problems. I\'m sure there are other websites like it.

Don't be discouraged. It takes a long time to learn. There are different ways to learn than through videos. projecteuler.net is a great programming challenge website. Java works well for most of the problem. I've learned a lot about elegant programming, arrays, and math just by solving a few problems. I'm sure there are other websites like it.