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
Can't start Greenfoot on my Mac
By Mark, with 1 reply.
Replied to by davmac, over 13 years ago:
What Mac OS version? Is it an intel Mac or a PowerPC variant?
Trouble using multiple key listeners
By Maxident, with 3 replies.
Last reply by mjrb4, almost 14 years ago:
I removed your duplicate reply :-) Builderboy is correct, isKeyDown() is the method you want to use here. The getKey method is more use in single key presses. As a general rule of thumb, if it's holding a key down for any length of time to complete an action (such as moving a character using the arrow keys) its isKeyDown() that you should use.
Method for moving around 1 step around grid each time a key is pressed?
By hesh, with 2 replies.
Last reply by hesh, almost 14 years ago:
That seems to be working! Thank you! Hahah! OK! :P For some reason I thought every 'if' method needed an 'else' line with it. My bad! ^^
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!
1051
1052
1053
1054
X