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
How to make actor appear to world
By gudgurl123, with 1 reply.
Replied to by danpost, over 7 years ago:
What do you have so far for the game over and loose class codes?
How to place objects in order as they are read from a text file
By Dom05, with 14 replies.
Last reply by Super_Hippo, over 7 years ago:
I just threw this together. Not tested or anything. Hope it works and/or helps.
Can I have help flipping my Immage
By Bandito, with 5 replies.
Last reply by Bandito, over 7 years ago:
That worked. Thanks for your help!
How do i add more than one class that can be added into a list?
By Bonobo, with 2 replies.
Last reply by danpost, over 7 years ago:
<Code Omitted>The above is not tested -- but, I believe it should work. Be advised that the elements are typed as Actor objects and, as such, the methods or fields that are declared in either of the two classes are not accessible without first casting any of the objects appropriately as the type they actually are (as a läufer or läufer2 type object; you can use the 'instanceof' conditional to check which class the object belongs to).
I am trying to switch images at a slower pace, but whatever I put in the counter it doesn't work to slow the images down when switching
By mouseofgory, with 2 replies.
Last reply by mouseofgory, over 7 years ago:
Thank you! Such an obvious mistake and I missed it!
Greenfoot low FPS and Speed
By SamuelIS, with 3 replies.
Last reply by danpost, over 7 years ago:
I do not see anything that would seriously cause any lagging. The suggestion Hippo gave to show the constructors of other classes might help. However, showing entire class codes would be more helpful so as to leave no stone left unturned (if you know what I mean).
How to make enemies go from one side to the other
By Toaster, with 7 replies.
Last reply by Super_Hippo, over 7 years ago:
<Code Omitted>
Play gif only once?
By Recorsi, with 2 replies.
Last reply by Recorsi, over 7 years ago:
It works, thank you very much :)
HTML 5 translation Error - maybe Math.hypot?
By Super_Hippo, with 7 replies.
Last reply by Super_Hippo, over 7 years ago:
It does. Thank you!
Eclipse source code problem
By jberrich, with 2 replies.
Last reply by jberrich, over 7 years ago:
this code : <Code Omitted>will be replaced by :
platform problem
By razenoid, with 5 replies.
Last reply by danpost, over 7 years ago:
This will be a bit complicated, especially since there is scrolling involved. The turn around points need to be fields, not just local variables, so that their values are retained from one act step to the next. Then, they will need to be adjusted anytime horizontal scrolling is implemented. Finally, after moving, the location and direction need checked for each turn-around point to determine if the actor is to turn around.
need help on my AI
By gaisuke, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
You have to write an algorithm for that. As long as the flag doesn't change its location and the maze doesn't change in some way, it is enough to calculate it once. I think the best way to do this would be to start at the flag, give it route length 0, the possible neighbor cells are then 1 and so on. And then, when you reach the AI, it will have a route length (X) too and can find the shortest route moving from X to X-1, X-2, ... to 2, 1, 0. You can then save this route in a list, so you don't have to calculate it again and again. I don't have the algorithm in code. Maybe you can find maze sc
Object Detection
By CavemanWrath, with 2 replies.
Last reply by CavemanWrath, over 7 years ago:
THANK YOU
Glitching "a,d,w,s" keys?
By ggongwer, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Maybe you can find you answer here:
https://www.greenfoot.org/topics/59948/
How do you make an object jump when the space bar is pressed?
By ThorneC, with 1 reply.
Replied to by danpost, over 7 years ago:
ThorneC wrote...
I am new to Greenfoot, so don't know much about it. If you could make your answers as simple as possible I will appreciate it.
This is really too general of a question with no given code to work off of (or with). The best general answer I can come up with is, using pseudo-code, something as follows: <Code Omitted>where vertical movement is done with a line of code similar to the following: <Code Omitted>
304
305
306
307
308
309
310
X