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
How do I spawn apples randomly?
By Ahmed780, with 3 replies.
Last reply by danpost, over 6 years ago:
Ahmed780 wrote...
Is this correct? << Code Omitted >>
In your last post, you have '60' times some random number up to '100', making a value up to '6000 for an x-coordinate (that part did not need any attention; so I do not know why you messed with it. Another thing I see is that you are placing the apples at negative valued y-coordinates by using '-i' in the addObject line. I am guessing your world is 800x600. If so, I think this is what you need: <Code Omitted>
Are children in 6 or 7 years old can use greenfoot ?
By EngAyaYasser, with no replies.
Hello , I am a teacher and I want to teach children java using greenfoot ,from my side I have experience in Java so I can teach concepts easily and I will follow up with them writing code but I am asking why most of websites say it will be difficult for children who their age less than 10 years old ? I want to know the challenges that will face children
RED & BLUE TEAMS
By genju, with 3 replies.
Last reply by danpost, over 6 years ago:
genju wrote...
danpost wrote...
One idea is to use a program like Paint to add the coloring to the sprites. You know, have all the needed images already in your
images
folder for use in the scenario.
but would i not have to have separate files for both teams?
Yes. How would that be a problem?
Greenfoot Main Method/Class that contains initialization of Actor objects
By JosephMiller, with 1 reply.
Replied to by danpost, over 6 years ago:
In greenfoot, the main method is hidden. Greenfoot automatically constructs your initial world, which is where you jump in with your coding. You put code in your initial world constructor to create any initial actors needed and add them into the world (even if it is just calling a method to do it).
"Non-static method 'getY()' cannot be referenced from a static context"
By yeeterboi420, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
Remove line 5. First, this line is executed once when the Block object is created. It doesn’t change when the player moves. Second, a class doesn’t have a location. An object does. In your case, maybe the following could work: <Code Omitted> If you want the condition to be independent on the x-coordinate, you need to get a reference to the Player in the world: <Code Omitted>
iteration issue
By PreciseRook, with 2 replies.
Last reply by PreciseRook, over 6 years ago:
Ah, you're right. My bad, I thought I mentioned the null pointer. Moving the myWorld into act() fixed it, thank you!
How do I display the score?
By Ahmed780, with 55 replies.
Last reply by Ahmed780, over 6 years ago:
Thank you so much!!! It finally worked.
Can I use greenfoot for the ap csp create project
By scaps, with 1 reply.
Replied to by danpost, over 6 years ago:
scaps wrote...
title
That might be a question better directed at your instructor.
How do I create a splash screen ?
By Ahmed780, with 1 reply.
Replied to by danpost, over 6 years ago:
Ahmed780 wrote...
I need to create a 3 min splash screen for my final project
You can use my
Combo Support Demo
scenario as an example. You would only need to add the timer.
I'm having trouble starting my Greenfoot Project!
By MYSTICPHOENIXXX, with 2 replies.
Last reply by Yehuda, over 6 years ago:
Is there an output console minimized or open displaying any sort of error? Or perhaps a syntax error? Try restarting the Greenfoot program.
Want to add a delay between when the green spawn.
By scaps, with 4 replies.
Last reply by scaps, over 6 years ago:
alr got it working thanks a million
need help with bullet collision
By scaps, with 2 replies.
Last reply by scaps, over 6 years ago:
Thanks it worked!
Acces class of new world without instanciate it?
By ytm, with 3 replies.
Last reply by danpost, over 6 years ago:
ytm wrote...
hi danpost thanks for your reply! it is to do an integrative test. I want to test that when the key is pressed in world X, the second world is created
What code have you tried for checking key press and checking world creation?
What does this mean?
By Ahmed780, with 2 replies.
Last reply by danpost, over 6 years ago:
The statement: <Code Omitted>is a variable declaration statement. It declares a variable, called
water
, that is of type
Water
. That is,
water
will only be used to reference an object of type
Water
(aka: a
Water
instance). It is not being assign any object at this time and therefore will take on a default value of
null
. So, (d). I did not include (a) because no object is yet referenced by the variable. I did not include (b) because
water
is an object reference to a
Water
instance -- not a
Type
instance. I decl
Reset command
By CardJitsu5, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
You can put this into your act method. (Somewhere before line 46.) <Code Omitted>
126
127
128
129
130
131
132
X