how do i make an actor move up and down continuously?
private int topBorder = 100, bottomBorder = 200, direction = 1;
public void act()
{
setLocation(getX(), getY()+direction);
if (getY()==topBorder || getY()==bottomBorder) direction *= -1;
}setLocation(getX(), getY()+speed*direction) if (direction *(range/2-getY()) > range/2) direction = -direction;
if (direction*(350-(getY()) > 250) direction = -direction;