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
Many errors that need fixing.
By OKNEM, with 10 replies.
Last reply by OKNEM, over 9 years ago:
Awesome. All are fixed. Thanks!
setImage() not generating image, please help!
By Fibonacci, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
You are removing the object from the world and then set a new image to it. The object now has indeed this explosion.png image but you don't see the image because the object is no longer in the world.
This is the class of enemy car that the player has to avoid.
This seems to be a little bit misleading because it seems like this car is the one which you can control. I suggest you add a new actor to the world which displays the explosion. As an alternative (because the game ends after the first crash anyways), you can just remove the 'myWorld.removeObject(this);' line. Btw, yo
eror at the font.PLAIN in Greenfoot 3.1.0
By szaborobert1, with 3 replies.
Last reply by MrBradley, over 9 years ago:
If you are referring to the font style modifier, you are correct. The new 3.0 version has changes that affect Fonts. Make sure you check the method signatures, you may also be using the parameter in the wrong location with the new changes. Always helpful to post a bit of code as well.
Scrolling World
By joshuadswa, with 5 replies.
Last reply by joshuadswa, over 9 years ago:
Okkk thx :) i will try to study it
[@danpost] How to center the "camera" in a scrolling world
By Super_Hippo, with 13 replies.
Last reply by danpost, over 9 years ago:
danpost wrote...
You should be able to just subtract 3162 from all your coordinate values before you use 'super.act();' (if I am not mistaken).
I probably was mistaken and you need to subtract 2762, not 3162. I was trying to find an easier way to center the town in the viewer. Experimenting with 'setMainActor(dorfzentrum, 0, 0)' followed by 'dorfzentrum.setLocation...' and 'super.act'; then 'setMainActor(maus...'. You would then have to 'addObject(dorfzentrum...' to add the object to the list of scrolling objects in the SWorld object.
Remove an actor
By Fifilein, with 4 replies.
Last reply by danpost, over 9 years ago:
What code are you using to add the snake into the world and where is it located? (show as much code as needed)
Help with costumes
By Avecinat, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Are the cells actors? If yes, save a variable to show if a cell is alive or not (you could also compare the image but I usually prefer using a variable (int or boolean). <Code Omitted> Just in case it is not working: (I am never really sure about this without testing)
jumping help pls
By ninjaFI, with 2 replies.
Last reply by ninjaFI, over 9 years ago:
thx
ask
By ajiereus, with 3 replies.
Last reply by aldrisang, over 9 years ago:
oops yeah i forgot to say boolean or int for mine, and i got my 0s and 1s mixed up. man i'm tired. i'm sure they'll figure it out :) ciao for now...
Updating an Image with UserInput
By SpicyEmpanadas, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
'String inputstring' (line 18) is not used for anything. Maybe it has to be 'text=...'?
Holding the mouse down
By Wasupmacuz, with 2 replies.
Last reply by Wasupmacuz, over 9 years ago:
danpost wrote...
You will need a Boolean field to track the state of the mouse button: <Code Omitted>Then, in your current code (if the above here is done first), you can utilize the value of 'shooting' (along with your 'firePause' field) to determine when to fire.
Thank you Dan!
backtracking
By Alexlazea, with 2 replies.
Last reply by Alexlazea, over 9 years ago:
because it will get way more complicate in the future and the posibilities will be more than just 6 And i really want to do it this way :D
Outdated Version?
By Freekywill, with 1 reply.
Replied to by danpost, over 9 years ago:
Freekywill wrote...
I am making a game, which works fine on my personal laptop, but this line of code doesn't compile when on my school computer, receiving the error message "cannot find symbol - variable type" < Code Omitted >
Maybe it works in newer versions of greenfoot because of generics, where the object returned by 'getObjectsInRange' is 'List<InventorySlot>' (this was implemented somewhat recently).
Pause and resume
By YunitaPutri, with 13 replies.
Last reply by danpost, over 9 years ago:
Super_Hippo wrote...
@danpost: I think the 'pauseAndResume' method replaces and 'pause' and 'resume' methods. This way it should stop the scenario from doing anything when space is pressed until enter is pressed. And if I understood Yunita correctly, it does work now.
Ahh. I missed the 'while' bit. Yes -- that would work; except for the fact that you will not be able to actually Pause the scenario (by way of the greenfoot UI 'Pause' button) when the scenario is actively paused.
Shooting Range
By joshuadswa, with 5 replies.
Last reply by joshuadswa, over 9 years ago:
OK thx all :D
390
391
392
393
394
395
396
X