This site requires JavaScript, please enable it in your browser!
Greenfoot back
Kujamaster
Kujamaster wrote ...

2011/10/19

How do I make the Screen go one step down?

Kujamaster Kujamaster

2011/10/19

#
I'm a university student and I have this Assignment where the screen is supposed to go one step down for every 10th ball from the cannon. It is a clone of the game Puzzle Booble.
GameCode GameCode

2011/10/20

#
To make the screen go down you have to make all your Actor-Subclasses go down :)
public void scrollDown(int fields)
{
    int n = getWorld().getObjects(Actor.class).size();
    for(int i=0; i<n; i++)
    {
        Actor a = getWorld().getObjects(Actor.class).get(i);
        a.setLocation(getX(), getY()- fields);
    }
}
This should work
GameCode GameCode

2011/10/20

#
*make all your Actor-Subclasses go UP
You need to login to post a reply.