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
Latest download and/or book scenario is broken for Asteroids
By egertner@monroviaschools.net, with 1 reply.
Replied to by davmac, about 8 years ago:
You need to remove the import of "java.awt.Color" at the top of any class which won't compile. The Greenfoot API changed in version 3.1.0 and some older scenarios aren't compatible with it;
full details here
.
Preventing Users to hold down key to gain infinite points
By CodingIsNotEasy, with 2 replies.
Last reply by CodingIsNotEasy, about 8 years ago:
Also, I forgot to mention what I'm trying to accomplish is a rhythm game that gives point based on how close you pressed the button at the "Target" area. Right now the notes are Random but plan on making them sync to a beat later on. Here is an example of something similar to what i want to make:
Youtube Link
]
Move actor up and down automatically
By Afrobotsigner, with 1 reply.
Replied to by danpost, about 8 years ago:
Afrobotsigner wrote...
I need to make my alien spaceship move up and down automatically without having to press any key. The movement needs to be continuous till the ship is shot down. I need to apply the setLocation method. What other code can I use?
You will need to track which direction the ship is currently moving. The speed is a constant and can be hard-coded or held in a field. The new y-coordinate of the ship in your
setLocation
line can then be expressed as 'getY()+dir*speed' or 'getY()+dir*5', for example. The 'dir' field, as an int, would hold a value of '1' or
Ninja is a meme on fortnite battle royale
By xxxAli-Axxx, with 13 replies.
Last reply by davmac, about 8 years ago:
No spamming the forum please. Accounts will be disabled if it continues.
help me to complete this scenarios
By Rio, with no replies.
hei, i have some problem. I want make some scene, and the scene is if the object not collect at all, it'll show the dialog. Help me to fix this problem. thx
Need help with switching images when 2 objects intersect
By ananyagarg, with 9 replies.
Last reply by danpost, about 8 years ago:
ananyagarg wrote...
I am still unable to change the photos once the second bullet hits because when the first bullet hits, he barrier disappears. << Codes Omitted >>
That is because the bullet is not being removed when hitting a barrier. In the
Bullet
class
hitBarrrier
method (as last shown), add after line 4: <Code Omitted>
Help with keeping score.
By Astrooocow, with 2 replies.
Last reply by Astrooocow, about 8 years ago:
Thank you so much! I completely missed that. :) It works as expected now!
Having problem with returning int.
By shadowsknife, with 1 reply.
Replied to by danpost, about 8 years ago:
The
getCount
method is not in the
World
class -- but in a subclass of
World
. You must inform the compiler which type of world it is in. For example, if the subclass is named
MyWorld
, then: <Code Omitted>Note that the
getWorld
method of the
Actor
class returns a
World
object (or
null
), which could potentially be of any subclass of
World
.
Need help with a school project
By dmumby6@gmail.com, with 1 reply.
Replied to by danpost, about 8 years ago:
Yes -- it is possible. No further help can be given with the limited information given (detail on game structure and what you are currently having difficulties with).
Using I/O File in Jar ends with FileNotFoundException
By Vesuv, with 2 replies.
Last reply by davmac, about 8 years ago:
Oh - and you won't be able to update the file using that method. If you really want to keep high scores persistent, I suggest looking into the Java Preferences API. There's a brief tutorial
here
.
Exported to jar - Game freezes when changing World
By Vesuv, with 5 replies.
Last reply by Vesuv, about 8 years ago:
Vesuv wrote...
I found the Problem. stupid me. I had a mistake in a different class, which I was sure would work 100%. Never trust your writing! <Code Omitted>
But thanks. :)
Image .PNG problem
By virtus, with 1 reply.
Replied to by Super_Hippo, about 8 years ago:
Seems like the name you use in your code is not the same as the name of the file (
RIGHT
vs.
Right
)
Anti-Gravity
By Venbha, with 4 replies.
Last reply by Super_Hippo, about 8 years ago:
Like this?
How... Please help
By Venbha, with 3 replies.
Last reply by Venbha, about 8 years ago:
So it
is
possible.
Need help getting a projectile to change direction with an Actor
By woopersnaper, with 2 replies.
Last reply by danpost, about 8 years ago:
There is also an issue with a stream of bullets instead of individual ones (a new one will be create for each act cycle the space key is held down. You will need a boolean field to track the state of the space key:
238
239
240
241
242
243
244
X