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
While loop
By Sauravbasyalking12, with 3 replies.
Last reply by danpost, over 5 years ago:
Sauravbasyalking12 wrote...
Could you please name one thing that can go wrong with a while loop
One thing that can go wrong is that the condition to loop remains true indefinitely -- so, execution is "stuck" in the loop. It will make it seem the scenario is "frozen" as the process never completes.
Check if object exists at specific coordinate
By Suavessence, with 2 replies.
Last reply by Suavessence, over 5 years ago:
That helps, thank you!
Help with Greenfoot.getKey()
By DatHeroAndy, with 5 replies.
Last reply by RcCookie, over 5 years ago:
Sorry mate, didn’t test run it. Good that you figured out how to fix it
How can i spawn more and faster?
By ShortScream, with 1 reply.
Replied to by RcCookie, over 5 years ago:
You can adjust the propability of objects spawning in line 10 by increasing 20, and you can decrease the maximum time between spawns in line 37 (what cache is set to)
How to Increase Speed Over Time
By CuzImMicah, with 13 replies.
Last reply by danpost, over 5 years ago:
Remove line 48, as it will delay everything -- not just the Igl
o
o actor. You only need one control value for spawning strawberries -- not two ( "
i
" and "
whileOff
" ) -- keep '
i
': <Code Omitted>(the above to replace from line 27 to 48). Raise "
75
" in line 25 to something in the mid to high 90s.
How to add wait
By ShauryaThapan, with 3 replies.
Last reply by ShauryaThapan, over 5 years ago:
Got it
Two players from the same keyboard
By WannaBeADeveloper, with 2 replies.
Last reply by danpost, over 5 years ago:
WannaBeADeveloper wrote...
I tried to copy the same class and change the inputs from the pressKey but it didn't nothing..
It would be better to have just one class where the input key values are variable, using a constructor with input key parameters.
How can I access Methods from a subclass of World in an Actor class?
By Dev_grey97, with 3 replies.
Last reply by danpost, over 5 years ago:
Dev_grey97 wrote...
could you please elaborate how I can add the actor to the world and how to use the method addedToWorld() ?
Show entire page of
MyWorld
class codes. Oh, line 3 above, given by me, is flawed. It should be: <Code Omitted>
Picture Switching Problem
By ItzLukeStorm, with 4 replies.
Last reply by ItzLukeStorm, over 5 years ago:
Thanks so much. It worked!
Is the Greenfoot project alive?
By Rabestro, with 3 replies.
Last reply by Roshan123, over 5 years ago:
And sorry becaz the reply has no relation to the topic
Complex numbers problem
By rhys, with 7 replies.
Last reply by danpost, over 5 years ago:
Use class name (
ComplexNumber
) for
static
method calls. Use instance variable name for non-
static
method calls. The
mod
method is not
static
, therefore: <Code Omitted>If you had a
static mod
method (which you do not -- at least, I did not find one in the class), then you might have something like this: <Code Omitted>
Lag
By Roshan123, with 10 replies.
Last reply by Roshan123, over 5 years ago:
Thank u!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! U wasted a lot of ur time i teaching a newbie After looking at the code i knew that my basic is not strong and i have to strive more(actually i knew it already) I have not been taught java. I m learning on my own and my basic is not so strong to understand ur code. Lastly i would like to say u that; when i will be a genius like u then i shall look that how u made fps Initially i thought that fps would be easy and easy to learn but now its not easy for me or a beginner
Curly bracket issue
By h-t-hi, with no replies.
I’m using Greenfoot on a Mac and every time I add a bracket in the grey section (i.e. if (getY() <=0 { ), the closing bracket at the bottom of the green section disappears, which won’t let the code work properly. Afterwards, Greenfoot crashed. Also, I have a second issue, there’s a white space that I cannot get to go away (the white block of space above the yellow section). Is this a Mac-related issue with Greenfoot, or am I doing something wrong? If so can someone help me fix this problem?? My work here: https://i.imgur.com/Y0uOnXi.png
Reading the value of the speed slider
By RcCookie, with 4 replies.
Last reply by danpost, over 5 years ago:
RcCookie wrote...
The other way does not work if you change the setting on the slider manually, it only works when setting it using code.
True.
Gravity in FlappyBird
By catbear, with 1 reply.
Replied to by danpost, over 5 years ago:
The statements in your act methods are not actions (not anything that would be done repeatedly). The first line in both act methods need to be removed, first and foremost. It is almost never wise to create an object in a class that describes (or defines) that type. The second lines only need to be done once, during the creation of said object. That means you can move both those lines to their respective class constructors. As far as the "gravity" issue, you will need to post the SharedResources class codes (so we know what you are working with).
110
111
112
113
114
115
116
X