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
Movement Help
By Robert2.0, with 5 replies.
Last reply by danpost, about 13 years ago:
Ok, first you need an instance int field to hold the changing limits. Then, you only need to check for that limit and when there, reverse the direction (which should also be held in an instance int field, storing one or negative one (so all you have to do is add that amount to the current y value) and get a new limit.
Find out if one Actor no longer exists in the world
By carhad, with 8 replies.
Last reply by carhad, about 13 years ago:
So I did that and It showed level2 at the start. Oh in the scenario there are more then one of the same actor in the world. And I also have to go now so.........Bye! For now.
Help with setting up a main menu
By Christineekhoury, with no replies.
My game is pretty much completed I just wanted to know how to add on a main menu....I current have just one world class called myWorld and all my actors are as follows Actor door object elevator platform stopper dropper box lever music control enemy turret tank projectile robo glob fall bat portal char (character) upgrade FPS overlay bullet sword
Help with collisions
By FlyingRabidUnicornPig, with no replies.
I have found the solution to my problem. Please do not reply to this topic.
Health for enemies
By henrYoda, with 26 replies.
Last reply by danpost, about 13 years ago:
You need to show more of the code surrounding this method. It could be something like improper bracketing.
method wait() in greenfoot
By kill, with 3 replies.
Last reply by danpost, about 13 years ago:
Compare the following code to my last post. It was pretty much word for word. <Code Omitted>
Game error
By geekykid2013, with 65 replies.
Last reply by danpost, about 13 years ago:
Again, you need to change the conditions in your 'checkNextLevel' method to properly qualify when to change worlds, and which world to change to.
Counter class
By DoctorProfessorYoshi, with 1 reply.
Replied to by davmac, about 13 years ago:
"the one on the website" - I'm not sure what you mean by that; just import the one that's included with Greenfoot ("Edit" menu, "Import class").
method wait() in greenfoot
By kill, with 1 reply.
Replied to by danpost, about 13 years ago:
Answered on another discussion.
Graphics/design
By MaxAlbert, with 2 replies.
Last reply by MaxAlbert, about 13 years ago:
It does, thank you!
Menu with a button
By JesusJesus, with 4 replies.
Last reply by JesusJesus, about 13 years ago:
Ach jetzt sehe ich erst durch deinen namen dass du deutsch bist^^ das hätte es für mich leichter gemacht naja egal ;)
Health bar
By manish1, with no replies.
Hello, i am currently working on a on a tank game, and need help with the health bar, i already have the getHit() method for the wall but i need to make a health bar, this is what i have: import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class wall here. * * @author (your name) * @version (a version number or a date) */ public class SeigeTower extends Actor { private int TowerHealth_; /** * Act - do whatever the wall wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public SeigeTower() { TowerHealth_ = 5; } public void act() { checkHealth(); checkDestroy(); } public boolean collides() { Actor a = getOneIntersectingObject(BouncingBullet.class); if(a == null) return false; getWorld().removeObject(a); return true; } public void checkHealth() { if(collides()) { TowerHealth_--; } } public void checkDestroy() { if (TowerHealth_ == 0) { World world; world = getWorld(); world.removeObject(this); } } }
Is there a world subclass that lets you have a large world but a small, movable, viewing window?
By m_p_v_13, with 9 replies.
Last reply by m_p_v_13, about 13 years ago:
Well, there are situations where an actor needs to keep absolute location information around across act() invocations. For instance, to keep track of it's, or someone else's, absolute velocity.
Snapping onto a cell
By Napler, with no replies.
Some people might wonder if there is a quick way to snap an object to a cell on the background, well here it is: for a 60 x 60 cell background, this object will snap right into the middle of the cell. first, the number of cells is counted and rounded to a whole number. then it is set to the closest cell that it was dragged to (My objects are dragged and when they are dropped, this executes).
Game Error contd.
By geekykid2013, with 1 reply.
Replied to by davmac, about 13 years ago:
You have two constructors (starting on line 26 and 33), and one of them has an 'inRobot' parameter and the other does not. However, they both try to access 'inRobot' in their body (line 29 and line 36). I guess that it's line 36 that's giving you the error, as you're trying to access a parameter that doesn't exist in this constructor. Why do you need the two constructors? Can you just remove the second one? Or just set 'robot' to null in the second one?
835
836
837
838
839
840
841
X