Ok, looks good so far. But wait... why does the println's return 0 and false respectively? It looks like they are at their default values. However if you initialize them inside of a method, they work fine. My best guesses are:1. I fell asleep in the java class where they told me about this. //HIGHLY LIKELY.2. There are aliens in my computer.3. This is a bug, or a corrupt JVM.

What are your thoughts/suggestions to resolve this?

P.S. If you hit tab while typing up up a post, it focuses you on the search bar. Sort of annoying when you are formatting code (Just my $0.02)

Ok, looks good so far. But wait... why does the println's return 0 and false respectively? It looks like they are at their default values. However if you initialize them inside of a method, they work fine. My best guesses are:1. I fell asleep in the java class where they told me about this. //HIGHLY LIKELY.2. There are aliens in my computer.3. This is a bug, or a corrupt JVM.

What are your thoughts/suggestions to resolve this?

P.S. If you hit tab while typing up up a post, it focuses you on the search bar. Sort of annoying when you are formatting code (Just my $0.02)

With the code you gave me, I get 1 and true on my end. Is there something we're missing that you're not providing?

EDIT: Also, this thread seems like it would have been better suited for the "Newbie and Debugging" forum. Not that you're a newbie!

Once every few months, Eclipse just stops compiling for no reason whatsoever, and you need to close & open the fileyou're editing, or restart Eclipse. Other cuases can be that there are issues with your build-path, which also stops the compiler (for good reason).

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

Once every few months, Eclipse just stops compiling for no reason whatsoever, and you need to close & open the fileyou're editing, or restart Eclipse. Other cuases can be that there are issues with your build-path, which also stops the compiler (for good reason).

I have never managed to have eclipse going for a month without having to restart long before then.

However more on topic i have had eclipse stop properly compiling and a simple restart was not enough. I had to "reimport" the project that was affected. ie delete the project then create the project again.

This has happened only twice.

Either way when i am a bit stuck i will always put a "is compiling/running this source" check in. Like a time stamp in the logs for example.

I have no special talents. I am only passionately curious.--Albert Einstein

Ok, I have done some debugging, and have found the cause of the error. It seems that if you have a protected method in the superclass, and you call it in it's constructor, it seems to just skip initializing the variables. However, if you call it in the subclass, it works great. I updated the code and it produces the error after a restart, and even after putting it in a new file. Also, I checked my build path, everything looks good, and it compiles fine.

Once every few months, Eclipse just stops compiling for no reason whatsoever, and you need to close & open the fileyou're editing, or restart Eclipse. Other cuases can be that there are issues with your build-path, which also stops the compiler (for good reason).

Agree, it happens to me a lot of times actually. Most of the time it was when I was working with some plug-ins; different version control and maven if I remember correctly. I have no idea why :S I tried everything, build, clear and build, editing and resaving file. Nothing would work. I had to restart eclipse.

Order of calls! That is the issue here. What is happening, my fine friend is this:1) MyGame Constructor is entered.2) Game Constructor is entered.3) Game initializer is called.4) MyGame.setup is called.5) MyGame.setup exits.6) Game Constructor exits.7) MyGame initialized is called.

Before anything except declaration (Not assignment) happens, the super class's constructor is called. After that returns, the assignment is allowed to happen.

Order of calls! That is the issue here. What is happening, my fine friend is this:1) MyGame Constructor is entered.2) Game Constructor is entered.3) Game initializer is called.4) MyGame.setup is called.5) MyGame.setup exits.6) Game Constructor exits.7) MyGame initialized is called.

Before anything except declaration (Not assignment) happens, the super class's constructor is called. After that returns, the assignment is allowed to happen.

Derrrrrrrrppppppp. That was a significant issue, as my whole game ran in the constructor like:

1 2 3

setup();run();exit();

But it's fixed now, with adding a simple start() method. Thank you everyone for helping me.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org