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 send an actor to another actor
By DPK, with 27 replies.
Last reply by Nosson1459, over 9 years ago:
Waiting to see it uploaded... .
How can I create new instances of an object?
By NussNinja, with 1 reply.
Replied to by Nosson1459, over 9 years ago:
When you want to add this trace from Ant you could do: <Code Omitted>.
Help laser spaceship
By emma123, with 1 reply.
Replied to by Nosson1459, over 9 years ago:
Make a new Actor to be the laser and whenever the correct button is pressed for shooting add a new Laser (to move in the same direction that you're facing).
isTouching detecting Transparency problem
By Brandawg, with 9 replies.
Last reply by Nosson1459, over 9 years ago:
danpost wrote...
How about just adding a transparent actor at the "hole" and if is touching it, fall. It should probably be a bit smaller than the hole itself to make allowance for the size of the actor falling through it.
That's an idea, or you can create your own isTouching method ( @author (Busch2207 (Moritz L.)) ) which looks for pixels (line 49 makes sure NOT transparent) instead of the whole image:
each object has a own counter
By Telko, with 1 reply.
Replied to by danpost, over 9 years ago:
It is easier to deal with one actor with a changing image than with two actor, having one with a changing image, and needing to deal with interaction between the two. You can accomplish this by keeping a reference to an image without any text and an 'update' method to apply the text on the image to be shown:
Flappy Bird Score
By mitrolex, with 9 replies.
Last reply by mitrolex, over 9 years ago:
Thank's guys, it works like a charm now.
Does Greenfoot.mouseClicked() only work if the parameter is the object itself (this)?
By SallySanban, with 46 replies.
Last reply by SallySanban, over 9 years ago:
Thank you very much, @Super_Hippo and @danpost! I was able to fix the door clicking and the background switching the way I wanted it to work. :)
Remove Object Problem
By joshuadswa, with 10 replies.
Last reply by joshuadswa, over 9 years ago:
Ok thx a lot sir :) have a nice day :D
Stop world problem
By joshuadswa, with 13 replies.
Last reply by joshuadswa, over 9 years ago:
Thx a lot :D both of you are the best ^^
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)
389
390
391
392
393
394
395
X