Project 32 of 35  ·  Scratch Programming  ·  Module 3
Module 3

Guess the Flag

Create a country flag quiz game with multiple choice answers and a score tracker.

🍓  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

Create a country flag quiz game with multiple choice answers and a score tracker. 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

  • Store flag images as costumes of a single sprite
  • Use pick random to select a flag each round
  • Display 4 answer buttons with one correct and three random options
  • Track score, lives and accuracy across 10 rounds
  • Show a grade and percentage at the end of the quiz

Step-by-Step Guide

  • 1Add 10 flag costumes to a flag sprite (draw simple flags or import images).
  • 2Create a matching list of country names in the same order as the costumes.
  • 3On start: pick a random number 1–10, switch flag sprite to that costume.
  • 4Set the correct answer variable to the matching item in the country list.
  • 5Create 4 answer button sprites. Set one to the correct answer, others to 3 random different countries.
  • 6When correct button clicked: change score by 1, play cheer sound, next flag.
  • 7When wrong button clicked: play buzzer sound, change lives by -1.
  • 8After 10 flags: show score out of 10 and a grade (A: 9–10, B: 7–8, C: 5–6, F: below 5).
  • 9Add a 10-second timer per question — auto-advance if the player doesn't answer.
  • 10Shuffle the answer button positions each round so the correct one isn't always in the same spot.

Extension Challenges

Finished the main project? Push further:

  • Add continent hints that appear after 5 seconds if no answer is given.
  • Add a high score leaderboard using cloud variables.
  • Add a world map backdrop that highlights correct countries after each round.