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
When mouse is clicked button change for "3 seconds"
By Yedya, with 4 replies.
Last reply by Yedya, almost 11 years ago:
Thanks alot! Works perfect! How can I + your rep?
How to getRotation() of an object
By JasonZhu, with 23 replies.
Last reply by JasonZhu, almost 11 years ago:
Come to think of it, isn't that exactly what you suggested?
Null Pointer exception
By Banginwithflavor, with 11 replies.
Last reply by Banginwithflavor, almost 11 years ago:
Excellent!!! Thanks for teaching me how to do that!
[Beginner] How to change speed/transparency with obj. collision
By eladage, with 4 replies.
Last reply by danpost, almost 11 years ago:
If you do not want the object to be removed from the world, change the 3-line code above to: <Code Omitted>
Issue with collision script
By penorzilla, with 1 reply.
Replied to by Entity1037, almost 11 years ago:
What you essentially want in a collision detection method is the ability to prevent the player from going into walls at all. This can be done by alligning the actor agenst the object if it touches it. It would also be better if you detect for actors at every cell in the area the actor is about to move into. This way, you can detect the actor first, and then move the player agenst the actor instead of letting the player move normally which could cause the player to move into it (if he's going fast enough) and glitch like you described. I made a completed scenario with good hit detection that us
I need help with movement
By Stylow, with 5 replies.
Last reply by shahparacha, almost 11 years ago:
I thing u have to do it again and do it other way :)
Buying Weapons + Not shooting laser beams?
By M4xin8or, with 1 reply.
Replied to by danpost, almost 11 years ago:
As far as laser v bullet shooting: laser shooting happens when a bullet is created every act method while bullet shooting will skip several act methods between each bullet creation. This is usually done by adding a shot timer that increments every act. When the timer reaches a certain value, create a new bullet and reset the timer. You can add a boolean field to your actor to allow creation of the pop-up; however you will also need two dual conditional 'if' statements to run accomplish what you want. If 'atLocation' is a method (or condition) that determines whether the actor is on the s
Need some help
By Multi, with 2 replies.
Last reply by danpost, almost 11 years ago:
Multi wrote...
I want the object to go to a random direction in the beginning
By placing the 'setLocation' statement with the 'getRandomNumber' call in the 'act' method, the object will erratically jump vertically until a new world is set due to the 'getX()<=20' or the 'getX()>=getWorld().getWidth()-1' checks. The initial location should be set when the object is added into the world.
Keeping Score
By pr2alede, with 2 replies.
Last reply by danpost, almost 11 years ago:
Have two field in your world, one for the current time and one for total combined time. Call them 'time' and 'totalTime'; and make them 'public' fields. Then when one level is ended and you need to move on to the next, use something like this: <Code Omitted>
How to open a new level
By CreepingFuRbalL, with 1 reply.
Replied to by Gevater_Tod4711, almost 11 years ago:
To check whether there are no more objects from a class you can use this code: <Code Omitted>If you add this code in a World subclass leave out the getWorld(). To set the world to a new world you can use the method Greenfoot.setWorld(World) e.g. like this: <Code Omitted>
Score Counter problems
By Acummings, with 7 replies.
Last reply by danpost, almost 11 years ago:
thefutureisnow wrote...
Well, (and I'm not sure exactly how well this would work). You would create a class (not a world or an actor class), and you would set score variables for it (make sure they're public, and if you set them private, make sure you have public methods in that class that can edit and view that variable). And then you would just do the following: <Code Omitted>Of course, make sure that you modify this for the correct variables.
All this does is create another object (just not a world or actor object) that is referenced in the first world.
Need help understanding code
By Gummy, with 3 replies.
Last reply by danpost, almost 11 years ago:
You would use both lines of code. The initial line in question to create the object followed by the statement to add it into the world. Review the code that is put into the 'prepare' method when you 'Save the world'.
Heath hearts problem
By PrezHawkeye, with no replies.
I'm trying to get my game to reset after the player loses a heart and when it reaches 0 the game ends. I also need the game to remember the score so that it will leave off where it was when the player died. My actor died with the eat method from the crabworld game. Also how do i increase the size of my health bar? <Code Omitted>
Won't Compile
By snobiz45, with 6 replies.
Last reply by snobiz45, almost 11 years ago:
Thank you!
Sound problems again
By Yedya, with 4 replies.
Last reply by Yedya, almost 11 years ago:
Is there a way arond this?
759
760
761
762
763
764
765
X