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
Jumping Physics
By SnowFlurry, with 2 replies.
Last reply by SnowFlurry, over 5 years ago:
Oh I see, thank you! The demo was very helpful.
Pong Score not working
By Sakura.Waifu, with 2 replies.
Last reply by RcCookie, over 5 years ago:
Well basically you could use a setup like this: <Code Omitted> This code basicall
adding omnidirectional attack animation
By LewisEro, with 1 reply.
Replied to by RcCookie, over 5 years ago:
Hello Lewis, the problem with your code is that if the mouse is clicked at all both if-statements will be true. That means that the image is first being set to left or right but immediatly after that to up or down. Try this one:
Moving Background
By RcCookie, with no replies.
Hey guys, I´m currently trying to implement a camera package that allowes to show a part of the world. I´ve got the Actors moving across the screen in their relative position to the selected one and now I´m trying to get the background image moving, too. Unfortunatly I just can´t get it to work, it just draws a weird shape of images layed onto each other on the screen and the part that is actually moving only moves in 45°-angles. I did not use the move method but only setLocation, and I´ve got no idea how to fix this. I would really apreciate it if someone could tell me how to simply draw the background image at an offset position. Here´s the code I used so far (h is the Actor the camera shoud look at): <Code Omitted> Thanks for any help! RcCookie
Cycle Character Animations based on Distance traveled?
By LewisEro, with 2 replies.
Last reply by LewisEro, over 5 years ago:
worked it out, thanks!
Attacking in 4 directions
By Zyrtex1, with 3 replies.
Last reply by Zyrtex1, over 5 years ago:
Ok nice now it switches the pictures to the actor doing the attack.
shooting
By bangtan, with 7 replies.
Last reply by danpost, over 5 years ago:
In the shoot method you already have, replacing all codes after the first "else" except the last 2 lines.
Walls in a maze
By HelpMehCode, with 2 replies.
Last reply by HelpMehCode, over 5 years ago:
Thank you so much for the correction for "Color(BLACK)". I fixed that and there is a different error. I am posting a new thread of the updated error code. Again, thank you so much.
Spawning objects at random?
By whattheheck, with 1 reply.
Replied to by danpost, over 5 years ago:
You cannot spawn objects from inside their class. Well, you can -- but the first must be spawned from outside the class and then they will spawn at an exponential rate that is not wanted. Have your world class randomly spawn the obstacles. The disappearing part can be done in the class of the obstacle.
showText error
By Mattzh, with 2 replies.
Last reply by danpost, over 5 years ago:
Switch the order of lines 62 and 63; then move line 21 to be between those lines. The error was trying to show text on the
null
reference returned by
getWorld
, as the actor was removed from the world already.
Help with recursion
By Zestix, with 14 replies.
Last reply by danpost, over 5 years ago:
Zestix wrote...
Pardon, it's in line 20. No need to help, though
Oh. So,
ListNode
is the
BinaryTree
class -- not
List
. I still do not see a 2nd constructor, however. Good luck.
How to
By HarveyP30, with 4 replies.
Last reply by HarveyP30, over 5 years ago:
Oh nevermind, I resolved it by having for conditions in an if using ||.
Error with import.java.awt.* and import.greenfoot.*
By Zachary2304, with 1 reply.
Replied to by danpost, over 5 years ago:
You are probably using a newer version of greenfoot at home. Try commenting out line 2 and line 24. Next to line 24, add the following line: <Code Omitted>
Best score and current score
By Daav3r, with 3 replies.
Last reply by danpost, over 5 years ago:
Daav3r wrote...
Everything in greenfoot
Have you imported the
HighScores
class and read its description?
Clicking on the transparent part of an actor
By Marcel_C, with 6 replies.
Last reply by Marcel_C, over 5 years ago:
Oh man thank you so much it works :D. I really appreciate your help!!
134
135
136
137
138
139
140
X