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.
-
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. -
turn
public void turn(double degrees)Description copied from interface:Turtle
Change the turtle's heading by a number of degrees clockwise. -
color
Description copied from interface:Turtle
Change the turtle's current pen color. -
draw
public void draw()Draw the image created by this turtle in a window on the screen.
-