Create A Simple Turtle Graphics Program

Project #1

Create a simple turtle graphics program. Below are a possible layout and turtle design.

Test by drawing shapes

Project #2

Create a simple game. Create a maze(s) the user must program a path through the maze, or any other game you can think of that requires drawing lines.

Possible Design Hint

Layers can determine what will be displayed on top of other element. For example, the turtle sprite will always be displayed on top of all other layers.

LayerUse/Description
Layer3top most layer
used for the turtle sprite
Layer2used for the lines drawn by the turtle
Layer1used for the grid
Layer0bottom most layer
used for background images,
mazes, background color, ...

Note: Layers are independent and can be displayed or removed without effecting the other layers.

Possible Layout Example

Little Turtle is designed to build a command sequence a few commands at a time.

  1. Enter one or two commands.
  2. Run the commands.
  3. Correct the commands or add new commands.
  4. Reset the "Drawing Area".
  5. Got to step 2.

Possible Commands

CommandExampleDescription
HH home, center the turtle in the drawing
area point in direction 0
MM 5move forward ? steps
LL 2turn left (0-6)
RR 6turn right (0-6)
UUpen up (stop drawing)
DDpen down (start drawing)
CC 3pen color (1-6)
SS 2pen size (1-9)

Note:

- Commands are case insensitive.
- Commands are a single letter usually followed by a space and number.
- A turn value of 0 reset the direction to 0. Direction 0 is a special direction. It points to the top of the drawing area. All other directions are relative to the move direction
- Unknown commands or values stop execution.
- The move step size is fixed and defined in the app configuration.

Possible Turn Directions (1-6)

image missing

Note:

- Turn directions are both left and right.
- Unknown direction values stop execution.
- Direction 0 is a special direction. It points to the top of the drawing area. All other directions relate to the move direction.
- There is 15° between turn directions.
- To turn more than 90°, execute more than one turn command.

Possible Turtle Example (25x31 pixels)

Draw A Spiral