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
Random object only appears once
By montiqs, with 4 replies.
Last reply by montiqs, about 7 years ago:
Thank you very much!
Lizard Dash
By itscarlwheezer, with 1 reply.
Replied to by danpost, about 7 years ago:
False views on that game.
Making an Object Disappear When Clicked
By rb6333, with 4 replies.
Last reply by itscarlwheezer, about 7 years ago:
The issue with your game is that the scope of the sniper covers the other image so you cannot click it. To fix this you want to make it remove the object when you click on specific coordinates, not on the object itself.
My Code Doesnt work
By hassan08, with 7 replies.
Last reply by Super_Hippo, about 7 years ago:
No, 3.5.0 already supports the ask method. So unless you have a your own Greenfoot class in your project or something, it should find the method. You could try to create a new scenario and only put in this code (comment out lines 25 and 30) and report back if you get this error. If yes, you could upload your scenario with available source, so we can check for ourselves.
Spawn Actors in Certain Area
By AdiBak, with 1 reply.
Replied to by danpost, about 7 years ago:
Dividing by 4 and then multiplying by 4 will still get you anywhere across the world, but only at any x-coordinate that is a multiple of 4. Take the value of 1/3 the world width and add a random up to 1/3 the world width.
Help increasing speed of an object each level
By taylor360, with 1 reply.
Replied to by danpost, about 7 years ago:
taylor360 wrote...
I need to find a way to increase the speed of the cars with each level to increase the difficulty.
Your car class will require an
int speed
field. Use it for moving and change its value when you change levels.
Who is the inventor of Greenfoot
By DrakeGuo, with 1 reply.
Replied to by rb6333, about 7 years ago:
The founders of Greenfoot are Michael Kölling and Poul Henriksen
best score and the score in the end game doesn't appear,it stays zero needs help!
By Tasya16, with 6 replies.
Last reply by Super_Hippo, about 7 years ago:
Why is the first code such a mess and not indented at all? You didn't say if the Score class works as intended. So is it showing the score correctly and only the Label class does not? You didn't show where you add the Score object to the world and not how you adjust its value (especially in case it does not work – check question above). Basically you should try to check which parts of the code are working and which specific part is not. And you should explain that. @Scorcher: The "int score" is not static, so it a) doesn't have to be set to 0 manually from the first world's constructor a
IA in a greenfoot project
By Fargesia, with 2 replies.
Last reply by Scorcher, about 7 years ago:
It would be time consuming, but you could just have it mindlessly trying to move pieces until it makes a valid move, then end its turn.
I am making a game where you have to click an actor then click another actor. The first actor needs to dissapear and a timer needs to start for the other actor which is clicked. How would i code that clicking function?
By MagicMaxi, with 5 replies.
Last reply by Super_Hippo, about 7 years ago:
Check the source code of this scenario. Maybe it can help you.
https://www.greenfoot.org/scenarios/23898
Regarding GIF
By Joyfu1, with 2 replies.
Last reply by Joyfu1, about 7 years ago:
Super_Hippo wrote...
"setImage" is a method of Actor, the World's equivalent is "setBackground".
Thank you so much!
Unable to add object to MyWorld
By Joyfu1, with 3 replies.
Last reply by Joyfu1, about 7 years ago:
danpost wrote...
What does any of the code in the class have to do with a scoreboard? and why would you not place the codes to add objects into your world in your
MyWorld
class?
If the scoreboard hits a certain number, we would like to add the object. We tried from MyWorld as well but it doesn't add the SmallAlienobject after the scoreboard hits a certain number. However, the AddStar works perfectly fine. Thank you!
Unable to execute project after code change in portable version
By LaurentB, with 2 replies.
Last reply by LaurentB, about 7 years ago:
Recompiling after code change does work: that's not the problem. The problem is that after all classes have been compiled after editing code, it is not possible to run the application from the main Greenfoot window: "Execute", "Pause" and "Reset" buttons are grayed (disabled) I've found a workaround: apprently Greenfoot configuration files that Greenfoot creates at first execution and modifies after configuration changes were corrupted. I had a 'greenfoot' folder into my personal folder, with files regularly updated by Greenfoot. I've deleted it and apprently everything works fine again no
Shooting an Object
By rb6333, with 2 replies.
Last reply by rb6333, about 7 years ago:
That would be great
Key calling method once on multiple objects
By MRCampbell, with 7 replies.
Last reply by danpost, about 7 years ago:
MRCampbell wrote...
Can you explain "return"? I though this was used to return something, an int or boolean.
The
return
command is used to cause an immediate break out of the method and "return" back to the method that called it. Once executed, no proceeding lines of code in that method are processed. In a
void
method, nothing will (or can) be returned. In a non-
void
method, only a value matching the return type will (or can) be returned. It is a control-flow type command similar to the
break
command (when void of a return type), which causes an immedi
186
187
188
189
190
191
192
X