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
Plants vs Zombies clone with Greenfoot
By pvz1999, with no replies.
<Video Omitted> Hey, here is a plants vs zombies clone. Github link and other details are in the youtube video description!
My gif wont play
By Pando, with 15 replies.
Last reply by danpost, over 6 years ago:
Pando wrote...
Is there a way to make an array of objects from DIFFERENT classes? Example. If i had multiple classes A, B, C... Z. Could i have an array that has something like << Code Omitted >>
Sure. You could have an array of
Actor
objects: <Code Omitted>which could hold a
Hero
object, an
Enemy
object, a
Wall
object -- any object created from any class that extends the
Actor
class (multiple extensions allowed). For that matter, you could have an array with any type object:
How to change worlds?
By JPEG, with 1 reply.
Replied to by danpost, over 6 years ago:
JPEG wrote...
Hiya, so I'm trying to make a game and to start off, you've got to have a homepage. As simple as it is, I'm struggling to make the tranisiton form the homepage to the next page. Can some one please help me with coding so that a new world comes up once 'play' is clicked? Should Play be an actor?
"play" could be an actor; although, it does not have to be. If the user has other options other than play, then an actor would probably be the appropriate choice. If playing is the only option, then an actor is not necessary. You could transition to the new world when the 'Run' b
My missile continues in all eternity and destroys object out of the frame after I shoot my missiles?
By JoNGrEeNfOoT, with 11 replies.
Last reply by JoNGrEeNfOoT, over 6 years ago:
Okay, thank you alot
Terminal Error: NullPointerException
By SpeckieChan, with 7 replies.
Last reply by danpost, over 6 years ago:
SpeckieChan wrote...
I downloaded the tutorial game from the website and there it works perfectly: << Code Omitted >>
As it should. Only one
Counter
object is created there.
random
By Adambruzac, with 3 replies.
Last reply by danpost, over 6 years ago:
Adambruzac wrote...
Between yes. I figured out how to stay between the walls on the length, but when it spawns, I need to find a way on how to not exceed the walls on the height if that makes sense.
Sounds like you have 4 conditions for one coordinate value and 2 conditions for the other; but the order of coordinates could be swapped. So either (the x-coordinate is between the inner and outer walls and the y-coordinate is between outer walls) OR (the x-coordinate is between outer walls and the y-coordinate is between the inner and outer walls). By "inner and outer walls", there are tw
no suitable method found for move HELP!!!
By shane11300, with 1 reply.
Replied to by danpost, over 6 years ago:
shane11300 wrote...
Tried making a game earlier and everything was going fine until when I was almost finished the game did not run because a message keeps on saying "no suitable method found for move", please help me I really need this game for my work:) Below is the code and the word "move" keeps on having the message pop up "no suitable method found for move". please help me:) << Code Omitted >>
Please show your Mover class code, as well -- and use code tags (square brackets with the word "code" before the code and same with "/code" after).
Rotating canon from the end
By dev4ltar, with 35 replies.
Last reply by dev4ltar, over 6 years ago:
yes, so on rot 360 it can't have direction = 1 or having Rot = 361, only direction = 0 or -1 so the rotation is 360 or 359- and so does 300 can't have direction = -1 or having Rot = 299, only direction = 0 or 1 so the rotation is 300 or 301+ thank you very much
Bullet moving in direction that actor is facing
By Pando, with 3 replies.
Last reply by Pando, over 6 years ago:
nvm i used found it out by using getRotation() in bullet class and changing speed (-/+) based on angle
help with breakout
By Quickske, with 3 replies.
Last reply by danpost, over 6 years ago:
Quickske wrote...
i'm sorry, but i still don't understand is. :s would it be possible to clarify it a bit further?
Please refer to
this page
of the java tutorials.
intersecting objects
By sarah02, with 2 replies.
Last reply by sarah02, over 6 years ago:
Thank u!
reloading ammo, help
By shah5826, with 17 replies.
Last reply by shah5826, over 6 years ago:
Great! thank you
Checking if an object of the same class as others are still in the world.
By iCookieMad, with 8 replies.
Last reply by iCookieMad, over 6 years ago:
Thanks for the reply, but I couldn't use that code (I probably didn't explain what I wanted very well). I came up with another solution where I'd remove and then spawn back in all the tiles, in one frame, so that they would all be restored. Thanks anyway though!
I need Help With An Assignment
By Sean03, with 1 reply.
Replied to by danpost, over 6 years ago:
You only need to combine the two conditions. In pseudo-code: <Code Omitted>The last line combines the two conditions and returns the result. This can also be simplified to this: <Code Omitted>without having to explicitly declare the boolean variables.
Making a timer
By Fargesia, with 2 replies.
Last reply by Fargesia, over 6 years ago:
Oh I get it thank you so much, seems logic now.
221
222
223
224
225
226
227
X