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
Variable not updating
By drayko543, with 1 reply.
Replied to by danpost, about 6 years ago:
drayko543 wrote...
I'm making a space invaders game and I want to put in a lives counter. I did this with a lives_left class which is a child of the player class.
If you mean lives_left extends player, then that is a problem. An extension of a class is to create instances of the class it extends, just with possible added (or modified) stuff. It could (1) add extra state (new fields); (2) add or modify behavior (new method or method override); or (3) any combination of (1) and (2) (including neither just to give special categorizing).
Greenfoot scenario not loading?
By lottie, with 5 replies.
Last reply by danpost, about 6 years ago:
In
MyWorld
class
addLeaves
method, your
while
loop's condition never changes. Execution gets caught in the loop because "i" is never greater than "18".
Images too big after upgrade to Greenfoot 3.6.1
By AlexDascalu, with 2 replies.
Last reply by Super_Hippo, about 6 years ago:
Do you use the windows scaling option? I have a 3840×2160 screen and set it to 200%. This also means that in GF, I only have a quarter of the size available (both half width and height).
How do I spawn apples randomly?
By Ahmed780, with 3 replies.
Last reply by danpost, about 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, about 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, about 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, about 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, about 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, about 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, about 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, about 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, about 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, about 6 years ago:
alr got it working thanks a million
need help with bullet collision
By scaps, with 2 replies.
Last reply by scaps, about 6 years ago:
Thanks it worked!
125
126
127
128
129
130
131
X