Project 03 of 35  ·  Scratch Programming  ·  Level 1
Level 1

Find the Bug

Build a timed clicking game where players score points by clicking a hidden bug sprite.

🍓  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

Build a timed clicking game where players score points by clicking a hidden bug sprite. 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

  • Use go to random position to move a sprite around the stage
  • Respond to sprite clicks using when this sprite clicked
  • Track score and time remaining using variables
  • Use a countdown timer to end the game
  • Display the final score when time runs out

Step-by-Step Guide

  • 1Create a garden or forest backdrop.
  • 2Add a small Bug sprite — draw your own or choose Beetle from the library.
  • 3Add a when 🏳️ clicked block and set score to 0 and timer to 30.
  • 4Add a forever loop: go to [random position] then wait 1 secs.
  • 5Add when this sprite clicked: change score by 1, play Pop sound.
  • 6Add a second script on the stage: repeat until <timer = 0> — change timer by -1, wait 1 sec.
  • 7When timer = 0: stop all and show say [Game over! Score: (score)].
  • 8Add a restart button sprite that sets score and timer back to their starting values.
  • 9Test and adjust the wait time to make the bug move faster or slower.
  • 10Try adding a sound when the bug is clicked.

Extension Challenges

Finished the main project? Push further:

  • Add decoy bugs that subtract points when clicked.
  • Make the bug shrink as the timer runs out.
  • Add two bug types with different point values.