Project 13 of 35  ·  Scratch Programming  ·  Level 3
Level 3

Nature Rover

Program a rover to explore a terrain, collect samples and avoid obstacles.

🍓  Open on Raspberry Pi Projects  ↗ Opens the official Raspberry Pi Foundation project — includes starter files and full step-by-step guide

What You Will Build

Program a rover to explore a terrain, collect samples and avoid obstacles. 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 rover using arrow keys with movement code
  • Detect and respond to obstacles using touching color or touching sprite
  • Collect items and update a score variable
  • Add a fuel system that depletes as the rover moves
  • Trigger terrain effects based on location

Step-by-Step Guide

  • 1Create a terrain backdrop with hills, rocks, water and a fuel station.
  • 2Add a rover sprite with wheel costumes for animation.
  • 3Add arrow key movement: up/down/left/right change x and y values.
  • 4Add obstacle sprites (rocks, trees). If rover touching [rock]: move back 5 steps.
  • 5Add collectible mineral sprites. When touched: change score by 1hide → reappear at random after 3 secs.
  • 6Create a fuel variable set to 100. In the movement code, change fuel by -0.5 each step.
  • 7Add a fuel station sprite. When touched: set fuel to 100 and play refuel sound.
  • 8If fuel = 0: stop movement and show say [Out of fuel!].
  • 9Add a mission list variable — show the number of samples still needed.
  • 10When all samples collected: play a victory fanfare.

Extension Challenges

Finished the main project? Push further:

  • Add a camera tool the rover can deploy to photograph rare species.
  • Add weather: a rain variable that slows the rover down when active.
  • Add a mini-map in the corner using a scaled-down copy of the backdrop.