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
setPaintOrder
By Imtrying, with 2 replies.
Last reply by Imtrying, almost 11 years ago:
Oh it's that easy? Thank you!
Left-Half
By RickAstley44, with 1 reply.
Replied to by danpost, almost 11 years ago:
Place the condition on the line that changes the images of the leaves. The left half of the world has x-coordinate values between zero and half the width of the world; so, the condition would be that the x-coordinate of the location of the leaf is less than half the width of the world (regardless the size of the world).
Flappy Bird
By sosimple, with 1 reply.
Replied to by danpost, almost 11 years ago:
You cannot use a 'for' loop for this action. The looping is created by the repeated calling of the act method by greenfoot. You can add an instance int field for vertical speed and increment it each act cycle to emulate the effect of gravity. When the mouse is clicked, either subtract a specific amount from the vertical speed or set the vertical speed to some nominal negative number. Use the value of the field as an offset for vertical movement (add it to the value returned when you call 'getY', instead of the literal '3' as in line 8 above).
Spawn mushrooms randomly on my game
By reportersnotebook, with 2 replies.
Last reply by reportersnotebook, almost 11 years ago:
Thank you so much it worked
Mouse info
By TentaBreak, with 18 replies.
Last reply by danpost, almost 11 years ago:
You cannot leave line 11 in your earlier post unchanged. Either it should not check for either type actor (Monkey or Banana instance) or it must check for both. If not checking for either, then you would then check for each type in the later conditional ifs (lines 1 and 7 in your last post). For now -- at least remove lines 12 through 16 in the last post from your code.
How to let an actor stop moving
By SuperPandaMario, with 1 reply.
Replied to by danpost, almost 11 years ago:
Lines 37 through 42 do absolutely nothing at all -- even if the conditions defined on line 37 were both true. This is because line 39 is declaring a local variable that in no way relates to the field declared on line 17. Remove the 'int' from line 39 so that you are referring to the already defined field declared on line 17.
How to make an actor follow a player
By AngelusNeko13, with 23 replies.
Last reply by AngelusNeko13, almost 11 years ago:
okay thank you, ill see what i can do
Search by subject
By TomazVDSN, with 2 replies.
Last reply by TomazVDSN, almost 11 years ago:
thanks
Boolean help
By Alan_c, with 3 replies.
Last reply by danpost, almost 11 years ago:
It seems to me that the score value alone can be used (being it is the limiting factor as to which level will be active). Or, to determine the current level: <Code Omitted>Now, this in itself does not tell you when to change levels. For that, you need to know when the score is changed from on level to another. Or, to determine a change in levels: <Code Omitted>
Greenfoot & Unity
By Trunksssj4, with 2 replies.
Last reply by Trunksssj4, almost 11 years ago:
Thanks Bro!
Need help with my gamecode.
By BreakingKratos, with 2 replies.
Last reply by BreakingKratos, almost 11 years ago:
It works! Thanks a lot for your help, I really appreciate it.
Need help with door and key(Lockpick) system.
By bilibull, with 17 replies.
Last reply by Super_Hippo, almost 11 years ago:
Yes, that's true. That's because the moving part makes sure the actor is not touching a closed door. You could insert the code that checks for the keypress to open the door in the last if-block of the last posted code. So the code that starts like that has to be added there: <Code Omitted>The next two lines are not needed because they are already in the other code. <Code Omitted> Hope you understand what I mean.
Please help score counter doesn't work
By Milan00, with 8 replies.
Last reply by Milan00, almost 11 years ago:
i somehow fixed the music too :D
Inputting and calculating a result
By coder04, with 28 replies.
Last reply by CALLUM13221, almost 11 years ago:
hi
class,interface, or enum expected HELP
By Hello, with 1 reply.
Replied to by danpost, almost 11 years ago:
Check your bracketing when you see that message. You have excess coding beyond the scope of the class (remove line 50).
505
506
507
508
509
510
511
X