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
Spawn players based on variable from another class
By Dormey, with 6 replies.
Last reply by Dormey, almost 7 years ago:
Ok it works now, thanks for your help
How do i get Tank track tracers in Greenfoot
By SushiLlama, with 1 reply.
Replied to by danpost, almost 7 years ago:
You have seen my
Tank Target Practice
scenario -- haven't you?
Got an error while trying to install the program
By Saereh, with no replies.
hello, I got an error saying installation package is not supported by processor type and I must contact the vendor. can anybody help me to solve this error?
Change the username
By KSH-Kinderkanti, with no replies.
Is it possible to change the username, once the account was created? I would like to keep my current username, but everything with lowercase letters, so that the kids can type it easily.
Tank Game Turret Rotation and Tank Movement Problem
By SushiLlama, with 19 replies.
Last reply by SushiLlama, almost 7 years ago:
danpost wrote...
Line 13 would be necessary, else line 5 would be useless. However, it is not something you would do on each iteration of the loop; but, only after the loop completes. Switch lines 13 and 14
Works like a charm!!! Wow! Thanks again :D
Moving HP bar
By andrewchin, with 3 replies.
Last reply by danpost, almost 7 years ago:
I am not sure why you do not get an error on line 55. I would think it needs to be: <Code Omitted>Out of curiosity, are your
hpbar
images animated? Just wondering because of the
gif
suffix. Please provide
hpbar
class codes.
One object (car) is hitting another Object(house). House will move after hitting. Car will vanish.
By spaceskull, with 4 replies.
Last reply by spaceskull, almost 7 years ago:
thank you so much
Number of objects in a list
By Bikey16, with 2 replies.
Last reply by Bikey16, almost 7 years ago:
Oh thanks, I'm so blind.
How to achieve Line Of Sight
By SickTrickz832, with 24 replies.
Last reply by SickTrickz832, almost 7 years ago:
danpost wrote...
SickTrickz832 wrote...
Ok, I changed the background image size to 800 x 800 and changed the world size to 800 x 800. The player now 'spawns' in the center of the world. However it doesnt stick to the center and the world doesnt scroll, the player just walks off screen
No -- do not do that. Just replace lines 15 and 16 with: <Code Omitted>
Gave it a go, works perfectly. Only think i gotta do now is make it so the actor doesn’t walk offscreen, and all other actors, like obstacles and pickups, move as well. Thanks for your hel
My code doesn't move to the actual minigame from the title screen
By sjyang24, with 1 reply.
Replied to by danpost, almost 7 years ago:
I am surprised that it compiles at all, as you do not seem to be importing
greenfoot.*
at all.
Replace Greenfoot.delay() with a clock/timer to prevent freezes
By SushiLlama, with 22 replies.
Last reply by SushiLlama, almost 7 years ago:
Wow thank you! And there wont be any delay? The opponent and I can move even while we are dropping bombs? Thats awesome! Ill try to improve my game further. For now i got no more questions. Ill come back if that changes. But for now i really want to thank you for your kind help! I really apreciate it! <3
Choosing Characters
By CodingCowgirl, with 8 replies.
Last reply by CodingCowgirl, almost 7 years ago:
Ok.
loops
By Yichui, with 1 reply.
Replied to by danpost, almost 7 years ago:
Yichui wrote...
for-loop scenarios (e.g. changing speed/image of an enemy once a certain score is achieved)
I do not see how your examples could have anything to do with looping. You would not continuously change an enemy's speed or its image multiple times between consecutive frames in the running of the scenario. Loops are used to execute code multiple times during the same act step (at one moment in time as far as a human is concerned). Only the end result will be apparent to the user. One of the first uses you might have for a
for
loop is to add multiple objects into
HealthGUI stops program immediately after world is constructed
By SushiLlama, with 3 replies.
Last reply by danpost, almost 7 years ago:
SushiLlama wrote...
Thats everything? Does the default case need it too? Thank you!!!
As long as the
default
case is listed last -- no. There is no more code in the
switch
after the last case, so it is not required for the last one listed.
Random objects
By vande, with 1 reply.
Replied to by SushiLlama, almost 7 years ago:
Hey, first of all you could give us more concrete Information, but ill try my best to help. Well Greenfoot.getRandomNumber(10) gives you a 0,1,2,3,4,5,6,7,8,9. So you would want to add 1 in order to start from 1 and end at 9 -> when you dont want to start from 0, you have to add the offset (difference of the higher number mius the smaller one). In your case that would be 10 because the highest number 25 is 10 away from your small number 15. So your code should look like this: public int getRandomNumber(int startNumber,int endNumber) { int offsetRandom = Greenfoot.getRandomNumber(en
167
168
169
170
171
172
173
X