java.lang.Objectgreenfoot.Actor
Turtle
public class Turtle
A basic turtle.
Constructor Summary | |
---|---|
Turtle()
|
Method Summary | |
---|---|
void |
addedToWorld(greenfoot.World world)
We need to make sure that our own representaion of the location is the same as the World's. |
void |
move(double distance)
Moves the turtle the given distance. |
void |
moveTo(double newX,
double newY)
Moves the turtle to the given position. |
void |
penDown()
Puts the pen down. |
void |
penUp()
Takes the pen up. |
void |
setColor(java.lang.String newColor)
Set the color of the pen. |
void |
setLocation(double x,
double y)
Set the location of the turtle. |
void |
setLocation(int x,
int y)
We need to override this method, so we can interactively move objects. |
void |
turn(double degrees)
Turns the turtle. |
Methods inherited from class greenfoot.Actor |
---|
act, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, setImage, setImage, setRotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Turtle()
Method Detail |
---|
public void addedToWorld(greenfoot.World world)
addedToWorld
in class greenfoot.Actor
public void move(double distance)
public void moveTo(double newX, double newY)
public void penDown()
public void penUp()
public void setColor(java.lang.String newColor)
public void setLocation(double x, double y)
public void setLocation(int x, int y)
setLocation
in class greenfoot.Actor
public void turn(double degrees)