This site requires JavaScript, please enable it in your browser!
Greenfoot back

danpost's Comments

Back to danpost's profile

Yes, you may. That was the purpose of creating it; so other may benefit from it. As far as referencing me, well, it would be nice (but not absolutely neccessary)! Voting is optional, also.
@Game/maniac, sp33dy, and justine Glad you like! Thanks for voting.
danpostdanpost

2012/2/21

Would be good to have some type of change when all the dots are gone (or when you die). A score, a level complete, a new level? Nice, but really needs more.
The 'NullPointerException' is one of the most common run-time error messages. It is telling you that you are trying to do something to nothing as if it were something. That kind of sounds strange, I guess, but in your case, after the fly is removed, it no longer has a world; therefore 'getWorld()' in the next line becomes 'null'; hence, the 'NullPointerException'.
The terminal window is there to assist you. You were getting a message that started with: Line 1: java.lang.NullPointerException Line 2: at Fly.die(Fly.java:135) Line 3: at Fly.act(Fly.java:32) Line 1 tells you why the scenario stopped (the error type) Line 2: tells you where in your code the error occurred (line 135 of the Fly class in the die() method) Line 3: may show where the method was called from (line 32 of the Fly class in the act() method) Lines 2 will not always be immediately after the error type, but will be somewhere in the message (it will be the first one that is recognizably in your scenario)
Reverse the last two lines of code in the Fly class (add the burger before removing fly).
I'll download and take a look.
I have to keep clicking on the 'Run' button 'cause it keeps stopping.
OH, I need glasses (and I have them on!) :/ I saw 1,138 kb (that is a 'one' followed by a 'comma', not a 'period').