java.lang.Objectgreenfoot.Actor
SmoothMover
public abstract class SmoothMover
A variation of an actor that maintains a precise location (using doubles for the co-ordinates instead of ints). This allows small precise movements (e.g. movements of 1 pixel or less) that do not lose precision.
Constructor Summary | |
---|---|
SmoothMover()
|
Method Summary | |
---|---|
double |
getExactX()
Return the exact x-coordinate (as a double). |
double |
getExactY()
Return the exact y-coordinate (as a double). |
void |
move(double distance)
Move forward by the specified exact distance. |
void |
move(int distance)
Move forward by the specified distance. |
void |
setLocation(double x,
double y)
Set the location using exact coordinates. |
void |
setLocation(int x,
int y)
Set the location using integer coordinates. |
Methods inherited from class greenfoot.Actor |
---|
act, addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, setImage, setImage, setRotation, turn, turnTowards |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SmoothMover()
Method Detail |
---|
public void move(int distance)
move
in class greenfoot.Actor
public void move(double distance)
public void setLocation(double x, double y)
public void setLocation(int x, int y)
setLocation
in class greenfoot.Actor
public double getExactX()
public double getExactY()