This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
Problem with java.lang.NullPointerException
By mahimahi42, with 3 replies.
Last reply by mik, almost 14 years ago:
If that line gives you a NullPointer, then that means that getWorld() returns null. getWorld() returns null if the actor is not in the world. (getWorld()essentially says "Give me my world" and in that case the actor does not have a world.) So either your actor has not been inserted into the world, or it has been removed from it. So make sure that printNumberOfOrganisms() does not get called while the actor is not in the world.
Keyboard inputs don't work?
By Maxident, with 5 replies.
Last reply by m.legere1323, almost 14 years ago:
aww =(
A challenge...?
By m.legere1323, with 3 replies.
Last reply by davmac, almost 14 years ago:
Sounds like two items of state: 1. An index into the array 2. A counter to measure how much time (how many act() cycles) have elapsed So, you declared these as fields. Then in your act() method you check the counter, and see whether the required time has elapsed: if (counter == 0) { .... If the time has elapsed then you do whatever you want with the appropriate item in the array. If that doesn't help, I guess you need to make your question more specific :)
Can someone spot the error of my ways?
By m.legere1323, with 3 replies.
Last reply by m.legere1323, almost 14 years ago:
@JL235 *facepalm* thank you =) @delmar thank you, its always good to see a shorter way of writing the code
AI Stuff Again...
By m.legere1323, with 6 replies.
Last reply by m.legere1323, almost 14 years ago:
That's exactly what I needed, thanks! I'm working on multiple scenarios right now, and I really appreciate all the help!
1052
1053
1054
1055
X