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
need help
By StudyNerd, with 4 replies.
Last reply by StudyNerd, over 6 years ago:
danpost wrote...
In changeHealth method, try changing first line to this: <Code Omitted>
thank you
PowerBar/HealthBar
By LightningFast, with 2 replies.
Last reply by LightningFast, over 6 years ago:
Thank you I'm taking a look at it right now!
image scaling is awful! need help!
By LightningFast, with 5 replies.
Last reply by LightningFast, over 6 years ago:
Sorry for a late reply... I took into consideration what you guys have said and fixed the code! Thank you! Here's the fixed code... import greenfoot.*; import java.util.*; public class Textboxes extends Actor { int t = 0;//counter GreenfootImage textArrays = {new GreenfootImage("RekaText1.png"),new GreenfootImage("RekaText2.png"),new GreenfootImage("RekaText3.png"), new GreenfootImage("RekaText4.png"),new GreenfootImage("RekaText5.png"),new GreenfootImage("RekaText6.png")}; //GreenfootImage array to store images public void act() { picTimer();
Deleting an object if two things are touching in the world class
By StudyNerd, with 4 replies.
Last reply by Super_Hippo, over 6 years ago:
So you want that a new key spawns every five seconds? I think I didn’t understand how collecting or not collecting is affecting the timer. Using a static variable for it seems pretty unnecessary though.
java lang runtime exception
By Manu3lll, with 5 replies.
Last reply by Manu3lll, over 6 years ago:
Thank you very much for you help, it worked.
method doesn't work
By StudyNerd, with 6 replies.
Last reply by StudyNerd, over 6 years ago:
danpost wrote...
StudyNerd wrote...
what do you mean?
Do you see a
HealthBar
object in your world? Is there no change in it -- and that is why you are saying it does not work?
I figured it out. Thank you for your time. You are a legend that replies to all the posts. Dan the man
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*/));
151
152
153
154
155
156
157
X