Package turtle

Class DrawableTurtle

java.lang.Object
turtle.DrawableTurtle
All Implemented Interfaces:
Turtle

public class DrawableTurtle
extends Object
implements Turtle
Turtle for drawing in a window on the screen.

PS0 instructions: do NOT change this class.

  • Constructor Summary

    Constructors 
    Constructor Description
    DrawableTurtle()
    Create a new turtle for drawing on screen.
  • Method Summary

    Modifier and Type Method Description
    void color​(PenColor color)
    Change the turtle's current pen color.
    void draw()
    Draw the image created by this turtle in a window on the screen.
    void forward​(int steps)
    Move the turtle forward a number of steps.
    void turn​(double degrees)
    Change the turtle's heading by a number of degrees clockwise.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DrawableTurtle

      public DrawableTurtle()
      Create a new turtle for drawing on screen.
  • Method Details

    • forward

      public void forward​(int steps)
      Description copied from interface: Turtle
      Move the turtle forward a number of steps.
      Specified by:
      forward in interface Turtle
      Parameters:
      steps - number of steps to move in the current direction; must be positive
    • turn

      public void turn​(double degrees)
      Description copied from interface: Turtle
      Change the turtle's heading by a number of degrees clockwise.
      Specified by:
      turn in interface Turtle
      Parameters:
      degrees - amount of change in angle, in degrees, with positive being clockwise
    • color

      public void color​(PenColor color)
      Description copied from interface: Turtle
      Change the turtle's current pen color.
      Specified by:
      color in interface Turtle
      Parameters:
      color - new pen color
    • draw

      public void draw()
      Draw the image created by this turtle in a window on the screen.
      Specified by:
      draw in interface Turtle