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
Collecting 3 key, avoiding enemies, and creating a labyrinth
By Jaisdreval, with 1 reply.
Replied to by danpost, over 6 years ago:
This
tutorial page has a section on
Saving the World
, which allows your actors to be immediately initialized.
getWorld().removeObject();
By NotAProYet, with 9 replies.
Last reply by NotAProYet, over 6 years ago:
Many many thanks! It is working just perfectly!
object spawner
By mercury, with 1 reply.
Replied to by danpost, over 6 years ago:
mercury wrote...
I am making a version of asteroids for a project how do I make an object spawner to spawn the asteroids
Your world is an object which can spawn actors into itself. Add an act method to your
World
subclass.
Starting Rotation
By AdiBak, with 3 replies.
Last reply by danpost, over 6 years ago:
@Archerfish, the general equation is: <Code Omitted>I am surprised you missed the "+1" immediately after stating why "121" was used.
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:
151
152
153
154
155
156
157
X