slogo.model
Class Turtle
java.lang.Object
slogo.model.Turtle
public class Turtle
- extends java.lang.Object
This is the Turtle model class. It contains all information pertaining
to the turtle's state, including location (x,y), pen position (up/down),
direction (0-360), etc.
- Author:
- gehmane
Constructor Summary |
Turtle()
|
Turtle(int x,
int y,
int startDir,
boolean penDown)
|
Turtle(java.awt.Point p,
int startDir,
boolean penDown)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
location
private java.awt.Point location
direction
private int direction
penIsDown
private boolean penIsDown
Turtle
public Turtle()
Turtle
public Turtle(int x,
int y,
int startDir,
boolean penDown)
Turtle
public Turtle(java.awt.Point p,
int startDir,
boolean penDown)
getLocation
public java.awt.Point getLocation()
getX
public double getX()
getY
public double getY()
heading
public int heading()
penIsDown
public boolean penIsDown()
move
public void move(int distance)
rotate
public void rotate()