Unlock the Pizzas on Scratch!

Create a Scratch game where you program characters to unlock pizza levels, learn sprites, blocks, variables, and simple animation with playful rewards.

Game Design30 min13 steps
Start buildingMore tutorials
Unlock the Pizzas on Scratch!
Unlock the Pizzas on Scratch!
30 minVibe coding
13 steps →

About this tutorial

Create a Scratch game where you program characters to unlock pizza levels, learn sprites, blocks, variables, and simple animation with playful rewards.

What you need

🧰Scratch account or Scratch app🧰colouring materials for drawing sprites (optional)

Step by step

  1. 1

    Step 1

    Open Scratch and create a new project.

  2. 2

    Step 2

    Rename your project to "Unlock the Pizzas".

  3. 3

    Step 3

    Add a Player sprite by choosing one from the library or painting your own.

  4. 4

    Step 4

    Add a Pizza sprite from the Sprite library.

  5. 5

    Step 5

    Duplicate the Pizza sprite two times so you have three pizzas.

  6. 6

    Step 6

    Add a Key sprite from the library and duplicate it two times so you have three keys.

  7. 7

    Step 7

    Drag the three pizzas and three keys to different places on the stage so each pizza has a nearby key.

  8. 8

    Step 8

    Create a variable called Keys for all sprites and add the block "when green flag clicked set Keys to 0".

  9. 9

    Step 9

    Program the Player to move: in the Player sprite add "when green flag clicked" then "forever" and inside place four "if <key [arrow] pressed?>" blocks to change x by 10 for right arrow change x by -10 for left arrow change y by 10 for up arrow and change y by -10 for down arrow.

  10. 10

    Step 10

    Program each Key so it can be collected: in a Key sprite add "when green flag clicked show" then "forever if <touching Player?>" then "change Keys by 1 play sound [pop] hide".

  11. 11

    Step 11

    Program each Pizza to unlock: in a Pizza sprite add "when green flag clicked switch costume to [locked] show" then "forever if <touching Player> and <(Keys) > 0> then change Keys by -1 play sound [cheer] switch costume to [unlocked] repeat 10 change y by 5 wait 0.05 change y by -5 wait 0.05".

  12. 12

    Step 12

    Test your game by clicking the green flag and play through collecting keys and unlocking pizzas and fix any blocks or positions that don't work.

  13. 13

    Step 13

    Save your project in Scratch and share your finished creation on DIY.org.

Fun facts

🐱Scratch was created at the MIT Media Lab so kids can code by snapping colorful blocks together!
🍕Over 5 billion pizzas are eaten worldwide every year—perfect inspiration for a pizza-themed game!
🧩Sprites are like actors in your game—each sprite can have multiple costumes you switch to animate them!
🧱Block-based coding helps beginners by preventing most syntax errors since blocks only snap where they belong!
🎉Small playful rewards (like unlocking pizza levels) boost player excitement and keep learners practicing!
🐱Scratch was created at the MIT Media Lab so kids can code by snapping colorful blocks together!
🍕Over 5 billion pizzas are eaten worldwide every year—perfect inspiration for a pizza-themed game!
🧩Sprites are like actors in your game—each sprite can have multiple costumes you switch to animate them!
🧱Block-based coding helps beginners by preventing most syntax errors since blocks only snap where they belong!
🎉Small playful rewards (like unlocking pizza levels) boost player excitement and keep learners practicing!

How do I make the "Unlock the Pizzas" game on Scratch?

To make 'Unlock the Pizzas' in Scratch, start a new project and create sprites: a player character, pizza targets, and locks. Use arrow-key blocks to move the player and 'if touching' blocks to detect pizza or lock collisions. Create variables like Score and Level, increase them when a pizza is collected, and broadcast messages to unlock the next level. Add simple costume changes or 'next costume' and 'wait' blocks for animation, plus sound effects as playful rewards.

Go deeper

What materials do I need for the "Unlock the Pizzas" Scratch project?

You'll need a computer or tablet with internet access (or the Scratch desktop app), a modern browser, and a free Scratch account if you want to save and share. Also useful: a mouse or trackpad, headphones or speakers for sound, and the Scratch costume editor or basic drawing tools to design sprites and backgrounds. Optional: a printed storyboard or checklist to plan levels, and colored pencils if you sketch ideas on paper.

Go deeper

What ages is the "Unlock the Pizzas" activity suitable for?

This game is great for ages 7–13 as an introduction to block coding, sprites, and variables; younger children (5–6) can play with close adult help using pre-made blocks, while older kids and teens can extend mechanics with lists, clones, or custom blocks. Adjust complexity—simpler movement and fewer variables for beginners, added levels, timers, or scoring challenges for advanced learners. Supervision is recommended for account setup and online sharing.

Go deeper

What are the benefits and safety tips for kids building Scratch pizza games?

Building 'Unlock the Pizzas' boosts problem-solving, sequencing, and creativity; kids learn variables, event broadcasts, and simple animation while enjoying immediate rewards. Safety tips: set a Scratch account to child-safe settings, avoid sharing personal info in projects or usernames, and review comments or remixes before allowing public sharing. Variation ideas: add timed levels, multiplayer unlocks, or create pizza-themed power-ups to teach branching logic and increase replay value.

Go deeper

Watch & Learn

Need help?

What can we use if we can't find a Key or Pizza sprite or the pop/cheer sounds in the Scratch library?

Choose or paint any similar library sprite (for example use a coin or cake instead of a key or pizza) and pick any available sound in the Sounds tab, then update the scripts so the Player touches the new sprite names and the Key/Pizza scripts use those sounds.

Why don't my Keys increase when I touch a key or why do I sometimes pass through a key without collecting it?

Make sure you created the Keys variable 'for all sprites' and have 'when green flag clicked set Keys to 0' plus each Key script uses 'show' before the touch check and 'hide' after changing Keys, and if the Player skips over keys reduce the movement step from 10 to 5 in the Player's arrow key blocks so collisions register.

How can I adapt this Unlock the Pizzas project for different ages?

For younger kids, simplify by using one pizza/key pair, enlarge the Pizza and Key sprites and increase Player step size to make collection easier, while older kids can keep three pizzas/keys, require more Keys per pizza by changing the '(Keys) > 0' test, or add a timer and score for challenge.

What are some easy ways to extend or personalize the game after it works?

Add a Score or Level variable, broadcast a 'next level' message to reposition pizzas/keys for new layouts, create extra unlock costumes and custom sounds for each Pizza, and let the child design custom Player, Pizza, and Key costumes before saving and sharing on DIY.org.

Your first game is on us.

Describe a game below - no sign-up needed to try.

KidsGPT has moved to ChatDino — powered by AstroSafe

Make me

DIY.org

Kid-safe AI for discovery and learning. Ask anything, explore everything, learn with confidence.

Product

  • Pricing
  • App
  • All Apps

Resources

  • Blog
  • Kids Wikipedia
  • Worksheets
  • Activities for Kids
  • Build a Hacker Simulator
  • SafeTube

Company

  • About
  • Terms & Conditions
  • Privacy Policy
  • AstroSafe
TwitterInstagramYouTube

© 2026 DIY.org. All rights reserved. · Powered by AstroSafe