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
jump n run please help
By jerno, with 1 reply.
Replied to by danpost, about 3 years ago:
Need codes for
Robby2
constructor and for
randonSpawn
method.
Ball being launched in a certain direction
By Gengar360, with 1 reply.
Replied to by Spock47, about 3 years ago:
It seems that "this.paddle" is null. Therefore: 1. Please give the source code where the constructor is called (new Ball(..., ...)). (if the first parameter is null, we found the problem) 2. Please change the line "public Paddle paddle;" to "private final Paddle paddle;". This ensures that the constructor is the only place "this.paddle" is set (otherwise one would have to check whether paddle gets changed somewhere else in the source code).
Boolean Turning Off by Itself
By LegoAJ, with 1 reply.
Replied to by LegoAJ, about 3 years ago:
Never mind, I figured it out.
Card Matching Game
By vinxl, with 2 replies.
Last reply by vinxl, about 3 years ago:
sorry to say I decided not to submit anything and fail my course. I just lost interest in programming :<
hi, I need help
By MATE-USER67, with 1 reply.
Replied to by danpost, about 3 years ago:
MATE-USER67 wrote...
I need a code that when a character touches a potion he can increase his speed and another that doubles the score when you pick up a coin THANKS advance
Add instance fields to the class of the character to signify that (1) potion was touched; and (2) coin was picked up. Use them to control the behavior of the character in the
act
method. Attempt some codes and if you run into trouble, show codes attempted for assistance.
i need help i new progamming
By sares97, with 1 reply.
Replied to by danpost, about 3 years ago:
sares97 wrote...
I need a code so that when a policeman collides with a coin he can create a temporary stun effect on enemies. I'm new to programming and thanks in advance.
Try the following field in your MyWorld class (or your game world class): <Code Omitted>with the following line in your MyWorld constructor block: <Code Omitted>and the following in your MyWorld
act
method: <Code Omitted> Then when policeman collides with coin, set the field to some positive value -- 60 units per second of stu
How does ask() method stops the scenario
By Roshan123, with 8 replies.
Last reply by Roshan123, about 3 years ago:
danpost wrote...
It doesn't. Line 49 prevents the loop from being infinite. When the "enter" key is pressed, execution "breaks" out of the loop.
Oh, okay and thanks a lot for the explanation and all
Changing Images and Properties of an Object
By Mauckenweg, with 6 replies.
Last reply by Mauckenweg, about 3 years ago:
Thank you SO much it works perfectly
Problem with adding double to double
By Turbo_Thorsten, with 3 replies.
Last reply by Turbo_Thorsten, about 3 years ago:
Thank yall for the answers. I got an easy solution but the explanation is very helpful :)
Cannot convert to HTML5: Error: Running TeaVM
By Ben_Jiang, with 2 replies.
Last reply by Ben_Jiang, about 3 years ago:
Thanks! I'll try and see how it goes.
Clara world
By killer, with 1 reply.
Replied to by danpost, about 3 years ago:
killer wrote...
i'm looking help for clara world Baking cake practical.
Please elaborate
in detail
and show any attempted codes.
Wait function
By HAHAHAHAA, with 1 reply.
Replied to by danpost, about 3 years ago:
HAHAHAHAA wrote...
I have a game, where if I click the up key, I want the actor to stop moving, hen after one one second, I want the whole game to stop.
Do not use the
wait
method within greenfoot. It is a thread operation and may mess up the execution of greenfoot itself. Use: <Code Omitted>
I need help with a code on how I can make an actor (in this case a zombie) fall behind me when I get close to him and when I walk away he doesn't chase me
By ELquenosabena, with 8 replies.
Last reply by ELquenosabena, about 3 years ago:
Thanks for everything
l need help
By track-hunt79, with 5 replies.
Last reply by danpost, about 3 years ago:
track-hunt79 wrote...
oh I understand and excuse me again but I'm new to programming and the code you sent me is placed in the obj class?
No. First part in class of zombie and second part in class of character that picks up coin. "obj" is just a dummy variable name to hold a zombie object.
Shop is not working
By ADAM68801, with 1 reply.
Replied to by danpost, about 3 years ago:
ADAM68801 wrote...
Hi, I have a shop in my game, and I want to click on a actor in shop whitch I want to play with, and then the actor shoud change in the game.
Either use a parameter in your game world constructor to pass which character was chosen or create the world and add the character before setting that world active. I am presuming that the character is not being changed mid-game.
38
39
40
41
42
43
44
X