Exercise 09: Turbo Turtles

We will be creating a simple game of racing turtles. The game is simple, five turtles face off in a race. First turtle to reach the checkered finish line wins!

This assignment will be worked on in your groups.

Setup

  1. Download the zip file containing the starter code.
  2. Extract the ex09 folder an place it into your cs102 folder
  3. Open the file turbo-turtles.py and turbo-functions.py with Thonny

Assignment

You need to create a turtle racing simulator. You will draw a staring line for the race and a black and white checkerboard finishline for the turtles to race toward. Each of the five turtles should be evenly spaced on the starting line, each a different color (but one must be purple) and move in a straight line towards the finish line.

Turtles will be selected at random to move a random amount of distance between 0 and 50 units, however, they cannot move more than half the distance of the checkered flag zone. Crossing the finish line for a turtle means that the turtle’s position is greater than location of the finish line. The turtle that crosses the finish line will spin counter clockwise two complete times ending at the same orientation it was facing. Text will then appear centered horizontally, and 20 pixels from the bottom of the window saying the which turtle won (e.g. “Purple Wins!”).

To create the playing field and the correct Turtle window size, you will want to use a sixth turtle that does not participate in the race to do this.

Here is an example of the full game being played:

race track

Hints

Submission

Right click your ex09 assignment folder and choose compress on MacOS or Compress to ZIP file on Windows. Upload the zip file to the matching Moodle assignment to submit your work. Submit one assignment per group!

Grading - 10 points