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

2013/5/19

Movement

FCG FCG

2013/5/19

#
How can I slow the movement of my actor slower then the speed of 1.
bourne bourne

2013/5/19

#
You could have something like this:
public class MyActor extends Actor
{
    private double x, y;

    public void act()
    {
        x += 0.1d;
        setLocation((int)x, (int)y);
    }
    public void addedToWorld(World world)
    {
        x = getX();
        y = getY();
    }
}
You need to login to post a reply.