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
Making enemies bounce off walls
By Neon147, with 6 replies.
Last reply by Neon147, over 13 years ago:
Ahhh okay it worked, thanks alot you two!
Donkey Kong Game barrel Srimulation
By toscany, with 1 reply.
Replied to by FlyingRabidUnicornPig, over 13 years ago:
Your code just doesn't work. What you're trying to do is delay the barrel, but your causing a "delay" that happens in a time before the program even renders everything. If you ever want a delay that lasts a couple of frames, never put it in a while statement. That while statement happens before a single frame is rendered. What you need to do is have an int that will keep track of the time since it last fired (by subtracting 1 from itself every frame), then have a method that will return true if that counter is 0. When the barrel fires, you tell the counter to go back to 50. So I would have
Rendering in Greenfoot
By Game/maniac, with 1 reply.
Replied to by danpost, over 13 years ago:
How about changing its image to 'new GreenfootImage(1, 1)'. I do not think that changing alpha to zero would help much, or at least noticeably, if at all. The system would still have to iterate through all the pixels, regardless.
Movement?
By Jin-Ho, with 1 reply.
Replied to by Gevater_Tod4711, over 13 years ago:
If you got a stop method you can use it but it would be easyer just not to move. So if you object touches another object you don't execute the move method: <Code Omitted>
Why does this not work
By Game/maniac, with 5 replies.
Last reply by Game/maniac, over 13 years ago:
thank you it works now
A charging ennemy
By Solringolt, with 4 replies.
Last reply by Solringolt, over 13 years ago:
I wanted to change the distance for y but your code helped me to do it ;) Thx for everything, I get it working.
Checking if in world
By FCG, with 3 replies.
Last reply by Gevater_Tod4711, over 13 years ago:
<Code Omitted>
How can I do it...
By Miikku, with 6 replies.
Last reply by Kartoffelbrot, over 13 years ago:
<Code Omitted>If this code shouldn't be in the soldier class, say it.
CODE Help
By FCG, with 4 replies.
Last reply by danpost, over 13 years ago:
FCG, you are going to have to learn to write some of the code yourself. At least give something a try and if you have trouble, post what you have tried and explain what you want to happen as compared to what is happening as it is currently coded. Much can be learned from the Greenfoot and Java tutorials alone.
transitioning through worlds
By Neon147, with 7 replies.
Last reply by danpost, over 13 years ago:
Yeah, I guess your world constructors are adding 'this' into the world immediately and therefore 'getWorld' for the next 'if' will return the new world.
Upward scroller
By programmer22, with 5 replies.
Last reply by FlyingRabidUnicornPig, over 13 years ago:
It seems if you want to follow from Into Space 2, you will have to have both a scrolling background and cloud or other objects that move down according to the speed of the rocket (I'm assuming you want to use a rocket). You may want to use this if you're planning on doing that: http://www.greenfoot.org/scenarios/5806 If you take a look at his methods, I think you would be able to get it. Or, if you want, you can make your own scrolling-like implemenation. However way you want to tackle it.
Add multiple objects of an Action and move the at intervals dynamically
By toscany, with 4 replies.
Last reply by toscany, over 13 years ago:
Thanks so much
Reset
By Jin-Ho, with 2 replies.
Last reply by Jin-Ho, over 13 years ago:
Thank you so much!
Neon147 wrote...
Have an object in your world by adding it, and that has method inside of that object that has something like this, public reset() { reset(); } public void reset() { if(Greenfoot.mouseClicked(this)) { Greenfoot.setWorld(new GameStart); //starts a new world } }
rotate image (switch)
By Nike.Sprite, with 25 replies.
Last reply by Nike.Sprite, over 13 years ago:
Ok I think I can work a bit further now, Thank you so much !
(btw, you got a new follower, you're a great greenfoot programmer)
good night
Nike Sprite
Help for the little shop.
By Miikku, with 1 reply.
Replied to by Miikku, over 13 years ago:
Help please.
833
834
835
836
837
838
839
X