Class ConfusedTurtle

java.lang.Object
  extended by SimpleTurtle
      extended by Turtle
          extended by ConfusedTurtle

public class ConfusedTurtle
extends Turtle

Class for a confused turtle. A confused turtle is like a turtle but it turns right when asked to turn left and left when asked to turn right.

Author:
Barb Ericson

Constructor Summary
ConfusedTurtle(ModelDisplay modelDisplayObj)
          A constructor that takes a ModelDisplay object
 
Method Summary
 void turn(int degrees)
          Method to turn by the passed degrees (a confused turtle will turn by 360- the passed degrees)
 void turnLeft()
          Method to turn left (but a confused turtle will actually turn right)
 void turnRight()
          Method to turn right (but a confused turtle will actually turn left)
 
Methods inherited from class Turtle
drawSquare, drawSquare, drawSquare2
 
Methods inherited from class SimpleTurtle
backward, backward, clearPath, drawInfoString, drop, forward, forward, 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

ConfusedTurtle

public ConfusedTurtle(ModelDisplay modelDisplayObj)
A constructor that takes a ModelDisplay object

Parameters:
modelDisplayObj - the thing that does the display
Method Detail

turnRight

public void turnRight()
Method to turn right (but a confused turtle will actually turn left)

Overrides:
turnRight in class SimpleTurtle

turnLeft

public void turnLeft()
Method to turn left (but a confused turtle will actually turn right)

Overrides:
turnLeft in class SimpleTurtle

turn

public void turn(int degrees)
Method to turn by the passed degrees (a confused turtle will turn by 360- the passed degrees)

Overrides:
turn in class SimpleTurtle
Parameters:
degrees - the amount to turn in degrees