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 somebody please explain me this code
By menshave, with 7 replies.
Last reply by danpost, over 8 years ago:
menshave wrote...
explain me what if(Greenfoot.mouseMoved(null)) means.
It asks if the mouse has moved. If it has, then a MouseInfo object is accessible, Since the location of the mouse is crucial here, this is the correct method to use for that determination. The MouseInfo object, in turn will contain the new location of the mouse.
what is targetx and y on the method move(). Is it the coordinate from the mouse?
Initially, it is the location of the actor (via the 'addedToWorrld' method). Once movement of the mouse is detected and from then on, it is the last known l
No object image
By ImAndrew, with 12 replies.
Last reply by ImAndrew, over 8 years ago:
danpost wrote...
ImAndrew wrote...
I don't get why using two getKey will not work.
You would have to understand the way the keyboard buffer works. Keystrokes are placed in an array with a pointer to the next key to be retrieved. When getting a key, the pointer is adjusted so the next key is ready to be returned on the next get. If this did not happen, the same key would be returned indefinitely.
Okay, now it's a little more clear, thanks, you saved my game a few times and learned me a lot of things xD
Rotation from a point that is not the middle
By Echarch11, with 3 replies.
Last reply by danpost, over 8 years ago:
nolttr21 wrote...
where?
Here.
It does not supply actual code; but, it does describe exactly what the code should do.
Can someone make me a game pls for my assignment its due next week?
By Tyleroneil72, with 9 replies.
Last reply by Santos_Hernandez, over 8 years ago:
Fine give me the pesos after, i can get u the game by next friday
I just wanna spawn one ball
By Sarwa35, with 5 replies.
Last reply by Sarwa35, over 8 years ago:
I got it but thanks for trying to help me
How to make enemies fire act main actor
By Lunatale, with 2 replies.
Last reply by xbLank, over 8 years ago:
I do not clearly understand your problem. Its common sense. You want an actor to shoot at another. So you know you need your actor2 to locate actor1 and shoot in that direction. Thats why I want you guys to
provide some code.
shooting in 4 directions
By Lunatale, with 3 replies.
Last reply by danpost, over 8 years ago:
Code each key separately. Use a timer for each to regulate the shots; or, use a boolean to track the state of each key to fire when a key is going from an up state to a down state.
The text isnt updating ,help me please
By PacArts, with 4 replies.
Last reply by Yehuda, over 8 years ago:
Yes. You need to execute the line of code which changes the display. Just changing the variable 'c' won't change the counter unless the 'lifeCounter' method is always being called (in the 'act' method).
I just wanna spawn one ball
By Sarwa35, with 1 reply.
Replied to by danpost, over 8 years ago:
Answered on another discussion thread. (Do not create multiple threads on the same issue please)
Getting a java.lang.NullPointerException
By Dimako21, with 1 reply.
Replied to by danpost, over 8 years ago:
Restriction in directions is due to speed and the hardware makeup of pixels of the screen (cannot be moved between pixels). The null pointer exception is probably due to the debris wanting to time itself out of existence when at an edge. If removed due to edge by line 23, removing due to time (line 30) will error as 'getWorld' will now return a 'null' value.
평범한 사람과는 달라 혼자만 있는 게 좋아.
By Tyleroneil72, with 2 replies.
Last reply by Tyleroneil72, almost 9 years ago:
Owen08 wrote...
Why do u suck so much
평범한 사람과는 달라 혼자만 있는 게 좋아.
Creating a door into next level
By Echarch11, with 9 replies.
Last reply by Tyleroneil72, almost 9 years ago:
일리아스 wrote...
I didn't copy that, therefor I cant give any source.
System.exit(0);
Creating doors
By Owen08, with 3 replies.
Last reply by Tyleroneil72, almost 9 years ago:
일리아스 wrote...
Please dont copy paste code. Use sources.
Source
I made it myself, you stole it from me, please source me.
Writing to an external file?
By dimako33, with 1 reply.
Replied to by J.A.M, almost 9 years ago:
Have you tried wikipedia yet????:((((
Writing to an external file?
By Dimak, with no replies.
Hello everybody, I am making a game for my final project and one of the requirements is to add the score to an external file. I browsed green foot forums and the best I found is the UserInfo Greenfoot API http://www.greenfoot.org/files/javadoc/greenfoot/UserInfo.html where you can save a score. Here is where the saving to an external source comes in, I want to instead save into some kind of online form ( Like an excel sheet ) where I can then go through the values column by column and row by row and display the best scores. Would that be possible? Because if I were to use something like the read and write methods provided by
Java
the user would then have to upload it somehow for it to show up for everyone else. Just as a recap I need to somehow save a name and a score in some kind of form that then can be accessed by anyone with the greenfoot file. ( Sorry for my bad english )
298
299
300
301
302
303
304
X