What You Will Build
Design a top-down boat racing game with obstacles, a countdown timer and lap detection. Follow the guide below to build the project, then open the official Raspberry Pi page for starter files, worked examples and extra help.
🍓 This project is on the Raspberry Pi Foundation website. Click the orange button above to access the full guide, starter Scratch project and extension activities on projects.raspberrypi.org.
What You Will Learn
- Control a boat sprite with arrow keys using a speed variable
- Detect boundary collisions that slow the boat down
- Add obstacle sprites that also cause slowdowns
- Implement a countdown timer and detect the finish line
- Add a simple AI boat that follows a fixed path at constant speed
Step-by-Step Guide
- 1Create a top-down water track backdrop with a start/finish line.
- 2Add a player boat sprite.
- 3Create a speed variable. Up arrow: speed +0.5 (max 5). Down arrow: speed -0.5 (min 0).
- 4Left/Right: rotate the boat direction. Move by speed in the current direction.
- 5If boat touching color [bank color]: set speed to 1 (slowed down by hitting the bank).
- 6Add 3 obstacle sprites (rocks, logs). If touching: set speed to 0.5 for 1 second.
- 7Add a 60-second countdown timer. When it hits 0: show time's up.
- 8Add a finish line sprite. When boat crosses it: stop timer and show completion time.
- 9Store a best time variable. Congratulate if current time beats it.
- 10Add an AI boat that follows waypoint sprites in a loop at constant speed 3.
Extension Challenges
Finished the main project? Push further:
- Add a second human player using WASD keys for split-screen style play.
- Add 3 different track layouts as separate backdrops selectable from a menu.
- Add a turbo power-up that temporarily sets speed to 8 when collected.