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
How to create objects after a certain period of time
By grnft, with 6 replies.
Last reply by grnft, about 8 years ago:
Of course, it was simple. Thanks for your help anyway.
How to use Wait
By Ticker175, with 11 replies.
Last reply by Ticker175, about 8 years ago:
Ok cool thanks =)
adding the amount of removed objects to my score counter
By grnft, with 2 replies.
Last reply by grnft, about 8 years ago:
You're a genius!
Adding a object at the edge of the screen
By grnft, with 2 replies.
Last reply by grnft, about 8 years ago:
You rescued my project!! Thank you so much!
Help with isAtEdge() method
By Catw24, with 1 reply.
Replied to by danpost, about 8 years ago:
Catw24 wrote...
I wanted that when my actor reaches the edge he should turn and then move forward but he's kind of stuck at the edge. It seems like it doesn't matter if he's facing the edge or not. If any part is next to the edge he'll just keep turning. Is there some way to modify this method
Use dual conditions for turning. Check at edge state and the rotation of the actor to determine whether to turn or not.
Help in Score addition
By kukusls, with 1 reply.
Replied to by danpost, about 8 years ago:
kukusls wrote...
<< Code Omitted >> That is my Score class which should be shown up on the enscreen(called gameover) aktHighscore should be an addition of "sekunden" and "MyWorld.collectablesCount" but it only shows up the MyWorld.collectablesCount Here my scoreboard class: << Code Omitted >> Furthermore, my Collectablescounter does acutally not reset when you press the Reset button in greenfoot and I dunno why Someone can help me?
You need to create a retain a
Highscore
object in your world and add it to the world when game is over (otherwise the start time will be the end
Bullets following my gun
By Mirco420, with 4 replies.
Last reply by danpost, about 8 years ago:
Mirco420 wrote...
I have got turrets which can shoot automatically. They can turn aswell but as soon as they turn, they bullets come out of the centre of the turret and not out of the gun anymore:D
In the Tower class, remove the "-80" from line 33 and insert at line 34 the following: <Code Omitted>Do similarly in the Panzer class, at line 45.
Bug in Shooting
By Vincent199000000, with 3 replies.
Last reply by danpost, about 8 years ago:
Line 19 in the
Kugel
class gets the x- and y-coordinates of the actor -- or, at least it tries to. The line will fail if the actor is not in a world -- and it will not be in a world if the bullet hits a
Rakete
object (by way of the call on line 18 to the
zerstöreDeutschgegner
method. Insert the following at line 19 (after the call): <Code Omitted>You will need to do similarly in the
Hindernis
and
Deutschgegner
classes, as well. The same type situation may also happen in the
Rakete
class; you can use and "else if" in t
Collision Detection From Different Sides
By Vise, with 1 reply.
Replied to by danpost, about 8 years ago:
Vise wrote...
Let's say I have a rectangular block. How would I determine if another actor is touching the top of the block or the bottom of the block or side of the block. Is it possible in greenfoot? If so, what is the general idea to do so and the methods needed for it?
The way I would handle it is by separating horizontal movement from vertical movement and using the direction of movement of each to determine how contact with an obstacle was achieved, allowing for the reversion or proper location setting upon such contact. The idea can be seen in the code of the
Who
class of
Updating my score board
By amazingfish, with 6 replies.
Last reply by amazingfish, about 8 years ago:
Thank you danpost! Love the solution!
Cannot find symbol error
By luc123, with 3 replies.
Last reply by luc123, about 8 years ago:
Thanks you so much
My snake tail won't become a tail, it just sits at a fixed position, any ideas?
By vaal, with 3 replies.
Last reply by danpost, about 8 years ago:
vaal wrote...
sorry my bad im a little weary, this is it << Code Omitted >>
I do not see any movement code for the tails.
Snake project, i would like to increase the speed of my snake when i eat a "diamond" but i cant get the variable right and now my snake doesn't want to move anymore,
By vaal, with 2 replies.
Last reply by vaal, about 8 years ago:
thanks i got it
How to make scoreboard and game over page appear?
By Alitzio, with 1 reply.
Replied to by danpost, about 8 years ago:
First, you need to remove the following line from both the
Score
and
GameOver
classes: <Code Omitted> You are not showing any code where you are eaten and a
GameOver
object is created.
how to make objects apear at the top
By bookguy, with 3 replies.
Last reply by danpost, about 8 years ago:
bookguy wrote...
<< Code Omitted >>
Other than the miss-spelling of
spawnCounter
on the first line and the unnecessary random height line, I see no problems with the code given. Show entire class code for a more complete review.
248
249
250
251
252
253
254
X