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
Final score
By Dayuyu, with 1 reply.
Replied to by danpost, about 9 years ago:
You could just have the final world add the Score object to itself with something like this: <Code Omitted>
pause button
By Dayuyu, with 2 replies.
Last reply by Dayuyu, about 9 years ago:
ok i have object overtop...now i fix that... it work.. thank..
Snake game- score counter
By nush99, with 1 reply.
Replied to by danpost, about 9 years ago:
Whether you want a visible counter or not, you can check out my
Value Display Tutorial
scenario.
Random timed movement, ranged player detection and camera tracking
By Parte, with 113 replies.
Last reply by Parte, about 9 years ago:
danpost wrote...
Parte wrote...
I have added a Movement_Test2 class because if the code for the movement (moving up,down,left,right) are in the same class as the Player class which contains the mouse movement; the player will merge with the walls when up against the walls as the player turns, to avoid this I split the movement of the player into a separate class.
There would be no difference had you placed the movement code in the act method of the class of the player. You can still be moving, or adjusting the location of the player, on similar conditions. That is, I realize that the im
Actor not in the world error
By ymym, with 2 replies.
Last reply by danpost, about 9 years ago:
You could also force an immediate exit from the act method by adding a return statement after removing the actor from the world: <Code Omitted>Any other actions you may want to do when the actor is removed can be done before the return statement (or even before removing the actor).
My game- snake eats food
By nush99, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Instead of line 44, use this: <Code Omitted>You have to rename the method to something else or it won't work (line 43 calls the method in which it is in which will call the method again and so on). And then, at the end of the act-method, you need a call to the new method.
Jump 'n' Run scrolling camera
By Tritos, with 4 replies.
Last reply by Tritos, about 9 years ago:
Thanks very much. It really helps me. I will try to get it to work for me tomorrow.
Problems with falling and getObjectAtOffset
By Tritos, with 8 replies.
Last reply by Tritos, about 9 years ago:
Thank you very much. That solution works perfectly and is exactly what I searched for!
Actor code not working for reasons so far unknown.
By ginger--ale, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Without showing the code you are talking about, it will be pretty impossible to guess what is wrong. Show the code and the error message.
Variables in Greenfoot methods?
By Gold_Leader, with 2 replies.
Last reply by Gold_Leader, about 9 years ago:
Thanks a lot! You are a life saver!!! ^-^
Why are powerups so confusing?
By dERPscHNOzzLE, with 24 replies.
Last reply by danpost, about 9 years ago:
dERPscHNOzzLE wrote...
it says incompatible types: java.util.List cannot be converted to greenfoot.Actor
Try using 'getOneIntersectingObject' instead of 'getObjectsInRange'.
Randomly playing background music and resetting the position of world objects
By Parte, with 15 replies.
Last reply by Parte, about 9 years ago:
danpost wrote...
I guess I forgot to start the music after setting the 'bgm' field in the 'play' method. Modify the method to this: <Code Omitted>
Thanks a lot!
Yet Another Score Counter!
By TheBluePhoenix, with 2 replies.
Last reply by TheBluePhoenix, about 9 years ago:
@Super_Hippo Oh my god! Thank you so much! Love the Greenfoot community, so easy to ask for help and not be criticised for "Being a NOOB." Thanks so much.
The two sound problem. Help please
By bian2205, with 2 replies.
Last reply by bian2205, about 9 years ago:
Thanks
Object Interaction Based on Image Size
By zmcclary1205, with 1 reply.
Replied to by danpost, about 9 years ago:
I would like to first suggest not to have fields for the image and its width and height. These can be acquired on the fly. For example: <Code Omitted>That way, you are ensured to get the actual current values for it size and do not have to worry about keeping track of them (which you really are not doing; you are re-scaling the images, but not adjusting the value of the fields for their height and width.
439
440
441
442
443
444
445
X