|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSimpleTurtle
Turtle
OppositeTurtle
public class OppositeTurtle
Class for an opposite turtle. An opposite turtle is like a turtle but it turns right when asked to turn left and left when asked to turn right. It goes backward when asked to go forward and forward when asked to go backward. It turns (360-amount) when asked to turn.
Constructor Summary | |
---|---|
OppositeTurtle(ModelDisplay modelDisplayObj)
A constructor that takes a ModelDisplay object |
Method Summary | |
---|---|
void |
backward(int amount)
Method to go backward by a passed amount (actually will go forward) |
void |
forward()
Method to go forward (actually go backward) |
void |
forward(int amount)
Method to go forward by the passed amount (actually will go backward) |
void |
turn(int degrees)
Method to turn by a given amount (actually will turn 360-amount) |
void |
turnLeft()
Method to turn left (but a dance turtle will actually turn right) |
void |
turnRight()
Method to turn right (but a dance turtle will actually turn left) |
Methods inherited from class Turtle |
---|
drawSquare, drawSquare, drawSquare2 |
Methods inherited from class SimpleTurtle |
---|
backward, clearPath, drawInfoString, drop, getBodyColor, getDistance, getHeading, getHeight, getInfoColor, getModelDisplay, getName, getPen, getPenColor, getPenWidth, getPicture, getShellColor, getShowInfo, getWidth, getXPos, getYPos, hide, isPenDown, isVisible, moveTo, paintComponent, penDown, penUp, setBodyColor, setColor, setHeading, setHeight, setInfoColor, setModelDisplay, setName, setPen, setPenColor, setPenDown, setPenWidth, setPicture, setShellColor, setShowInfo, setVisible, setWidth, show, toString, turnToFace, turnToFace, updateDisplay |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OppositeTurtle(ModelDisplay modelDisplayObj)
modelDisplayObj
- the thing that does the displayMethod Detail |
---|
public void forward()
forward
in class SimpleTurtle
public void forward(int amount)
forward
in class SimpleTurtle
amount
- the amount in pixelspublic void backward(int amount)
backward
in class SimpleTurtle
amount
- the amount in pixelspublic void turn(int degrees)
turn
in class SimpleTurtle
degrees
- the amount in degreespublic void turnRight()
turnRight
in class SimpleTurtle
public void turnLeft()
turnLeft
in class SimpleTurtle
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |