A fun desktop racing game built with Python's Turtle graphics library. Pick your turtle, watch the race, and see if your racer crosses the finish line first!
- Run the program — a popup will ask you to pick a turtle color
- Type one of:
red,blue,green,orange, orpurple - Watch the race unfold on screen
- See if your turtle wins!
- Click anywhere on the screen to close the window when done
- Python 3 — core programming language
- Turtle — Python's built-in graphics library (no install needed)
- Random — built-in module used to randomize each turtle's step size
-
Make sure Python 3 is installed:
python3 --version
-
Run the game:
python3 turtle_racers.py
No external libraries required — both
turtleandrandomcome bundled with Python.
turtle_racers.py # Main game file (all logic in one file)
README.md # Project documentation
| Section | What it does |
|---|---|
| Screen setup | Creates the 700×400 game window with a light blue background |
| Turtle creation | Spawns 5 colored turtles stacked vertically on the left side |
| Finish line | Draws a vertical line at x=300 using a hidden turtle |
| Race loop | Moves each turtle forward a random 1–10 pixels per frame |
| Win detection | Checks if any turtle crosses x=300 and displays the result |
- Change the number of racers — add or remove colors from the
colorslist - Adjust race speed — tweak
random.randint(1, 10)to a different range - Change the track length — update the
300finish line x-coordinate andscreen.setupwidth
Jay — Student Project
University of New Orleans