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
Write a new public method in your Ocean class called addMinnow(). This method should pick a random x/y location in the ocean and add a single minnow there.
By Atharva1912, with 2 replies.
Last reply by Atharva1912, about 6 years ago:
Thanks a lot
Help with Shield for Asteroids
By elsmog, with 3 replies.
Last reply by danpost, about 6 years ago:
elsmog wrote...
I am wondering how to implement a shield that deflects asteroids rather than ignoring them, as I do now. << Code Omitted >>
This may not be quite so easy to do. Remember that both the asteroids and the rocket are drifting/moving. It may not be enough just to change the direction of a colliding asteroid. In my
asteroids
scenario, which has shielding implemented, I had both colliding actors change their trajectories with the help of a smooth moving system. You may want to take a look at its codes -- especially the
showText method in World class
By SnowFlurry, with 1 reply.
Replied to by danpost, about 6 years ago:
SnowFlurry wrote...
Does the showText method in the MyWorld class allow one to change the font and colour of the text?
No.
How can i spawn some things random ?
By schniggi, with 3 replies.
Last reply by danpost, about 6 years ago:
schniggi wrote...
Could you please send me an example i donn know how to write this correctly
What have you tried?
pendulum
By ronald, with 9 replies.
Last reply by ronald, about 6 years ago:
great, thank you
Need help on what codes to use for my game
By popo88, with 3 replies.
Last reply by danpost, about 6 years ago:
Well, get that much done so you have something to work with.
need help using MouseClicked method with an actor
By Joshua09, with 1 reply.
Replied to by danpost, about 6 years ago:
The
mouseClicked
method does not look for clicks on classes. It looks for clicks on a specific object (or any click when the argument is
null
). If the code given is in your
Block
class you can use
this
as the argument. For the world, you can simply use
getWorld()
for the argument.
Help!! Exercise 9.73 in book! Asteroids!.
By Daav3r, with 13 replies.
Last reply by Daav3r, about 6 years ago:
Aaa hahahah okey xd
Greenfoot database connection
By Manu3lll, with no replies.
Hello, Do anybody have a idea how to import the mysql-database driver into Greenfoot?
show bounding boxes and anchor points
By mich@elbecker.de, with 1 reply.
Replied to by danpost, about 6 years ago:
mich@elbecker.de wrote...
1. collision detection uses bounding boxes. Is it possible to show these bounding boxes around actors in the world?
The bounds are determined by the dimensions of the images set to the actors -- meaning the bounded areas are always rectangular.
2. Every actor has an anchor point. (I don't know whether this is the correct term; I mean the point that I set with Actor.setLocation(int x, int y).). Where is this anchor point in the image of the actor? Is it allways the center of the image?
Yes -- and no. There is no exact center along a dimension o
Logs in Frogger
By repertoire, with 1 reply.
Replied to by repertoire, about 6 years ago:
From restarting alot this is what i really have so far. Other than that i don't know where to go. <Code Omitted>
Objects...
By Starlord_20, with 1 reply.
Replied to by danpost, about 6 years ago:
Starlord_20 wrote...
I want to create multiple Text objects << Code Omitted >> that's what I thought about, but it doesn't work...
There is no
setImage
method available to the
Object
class. That method is declared in the
Actor
class. Therefore, the object created must be, at least, an
Actor
object. Next thing -- because the
Actor
class is abstract, you cannot use: <Code Omitted>You will need to use an extension of the
Actor
class. I would usually use either:
NullPointer Exception
By Starlord_20, with 2 replies.
Last reply by Starlord_20, about 6 years ago:
oh...fixed. thank you!
Create objects at random intervalls
By Starlord_20, with 11 replies.
Last reply by Starlord_20, about 6 years ago:
The int spawnTimer got negative because the Asteroid was still there, so I added a condition which kept the int on 0 and then it worked. thanks @danpost and @Super_Hippo!
Splitting big rocks
By Libraoct7, with 2 replies.
Last reply by danpost, about 6 years ago:
You may want to remove the touching shot (and add small rocks), then remove the big rock (
this
). The shot was probably removing the small rocks immediately (because it was still in the world). You may want to adjust where small rock #3 is added into the world at (it currently is set to the same location as small rock #2).
133
134
135
136
137
138
139
X