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
Score Counter Does Not Work
By JaneSmith, with 15 replies.
Last reply by suzbo, over 6 years ago:
Thank you for all your help
Greenfoot wont tell me what's wrong
By Ran, with 1 reply.
Replied to by danpost, over 6 years ago:
Ran wrote...
Greenfoot ignores any attempt I make to compile a class, thus leaving it unusable, but also refuses to tell me which code isn't working. It shows me nothing as missing an element or not formatted correctly.
Sometimes closing the greenfoot application and restarting it will help.
Can you fix my code
By KylesGallery, with 12 replies.
Last reply by danpost, over 6 years ago:
KylesGallery wrote...
Could you send me what the array would look like, I've tried to use arrays before for a similar purpose but could figure out how. I searched for it before for awhile and I couldn't findo something that works, thanks.
An int array would be declared like this: <Code Omitted>and assign an array (of length 5) like this: <Code Omitted>Then you can assign random values by iterating through the array like this: <Code Omitted>
how to put a delay or pause on a method
By Tietie12, with 5 replies.
Last reply by danpost, over 6 years ago:
Tietie12 wrote...
do you mean replace the if statement for double jump with that condition? i am just confused to where i should add that condition.
I mean to add it to the condition you already have.
Bee simulation
By BJanssen, with 1 reply.
Replied to by danpost, over 6 years ago:
BJanssen wrote...
I have to make a school project about a bee simulation. I have to simulate how the bees find a flower and go back to their beehive. The bees will dance at the beehive to indicate where the flower is. We don't really know how to do this.
You will probably need a field that will indicate whether the bee is dancing or not. The bee won't dance forever, so an int timer field will probably do best. Maybe something like the following:
Hello how could i summarize my code
By SanjiNaha, with 1 reply.
Replied to by danpost, over 6 years ago:
SanjiNaha wrote...
how could i summarize my code
A class with useless image fields and unnecessarily repetitive action. Your
GreenfootImage
fields,
image1
thru
image5
are never used and the
constructor
method, called every act cycle, constantly creates new images for those fields. There is more code that is for naught. Let's clean it up a bit:
help
By SanjiNaha, with 4 replies.
Last reply by danpost, over 6 years ago:
SanjiNaha wrote...
the thing is that i have a fighting game and when the character jumps he goes through the screen
Sounds like you need an extra condition placed on when to jump.
How can I move all Objects in World except for the Player
By alkwmd21ij, with 2 replies.
Last reply by alkwmd21ij, over 6 years ago:
Thanks!
How to make ball reset back to middle after hitting the wall and game over screen?
By sisi12, with 1 reply.
Replied to by KylesGallery, over 6 years ago:
Try making score a
public static int
and adding a new world with your game over screen set as the background PNG file heres what you might do to output the score setImage(new GreenfootImage("Your Final Score Is : " + actor.score, 15/*size of text*/, Color.RED/*Font Color*/, Color.DARK_GRAY/*Background Text Color*/));
How to smoothly move images out and into world?
By alkwmd21ij, with 2 replies.
Last reply by alkwmd21ij, over 6 years ago:
Thanks!
levels in space invaders
By Sebastiano, with 2 replies.
Last reply by KylesGallery, over 6 years ago:
Like whats happening when it attempts to spawn the actors?
Image won't show in the world
By LightningFast, with 8 replies.
Last reply by danpost, over 6 years ago:
All I see are constructor in the subclasses. There is nothing to suggest any value changing. I do not even see an active value field in them.
adding only 1 actor
By TakedaYeet, with 2 replies.
Last reply by TakedaYeet, over 6 years ago:
wow! that worked perfectly, thank you very much!
moving with the mouse
By Bigbobatesloppyjoe, with 11 replies.
Last reply by Bigbobatesloppyjoe, over 6 years ago:
never mind I figured it out thanks for helping.
Keep Getting Null Pointer Execption
By Viransh, with 5 replies.
Last reply by danpost, over 6 years ago:
Viransh wrote...
How exactly do I assign the same objects that are already created in MyWorld? Please help me.
You could try this: <Code Omitted>at the beginning of your
Snake act
method, with something similar for the Food object.
152
153
154
155
156
157
158
X