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

Flappy Parrot

Build a Flappy Bird style side-scrolling game where a parrot avoids moving pipe 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

Build a Flappy Bird style side-scrolling game where a parrot avoids moving pipe 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

  • Simulate gravity using a yVelocity variable that is reduced each loop
  • Apply an upward force when the spacebar is pressed to make the parrot flap
  • Create scrolling pipe obstacles using clones that move from right to left
  • Detect collision with pipes or the screen edge to end the game
  • Track and display the score for pipes successfully passed

Step-by-Step Guide

  • 1Create a sky backdrop with a simple ground strip.
  • 2Add a parrot sprite with 2 flapping costumes.
  • 3Create variable yVel set to 0 on start.
  • 4Forever loop: change y by (yVel), change yVel by -0.4 (gravity).
  • 5When [space] pressed: set yVel to 8 (flap upward).
  • 6Add a pipe sprite. Create clones every 2 seconds at a random gap height.
  • 7Each clone: change x by -4. When x < -240: change score by 1, delete this clone.
  • 8If parrot touching [pipe] or touching edge: stop all, show game over.
  • 9Speed up pipes: increase clone move step by 0.2 every 5 points.
  • 10Add a best score variable that saves the highest score achieved.

Extension Challenges

Finished the main project? Push further:

  • Add different bird skins that unlock at score milestones (5, 15, 30 points).
  • Add moving gap pipes that shift up and down as they scroll.
  • Add coin collectibles between pipes that add bonus points when the parrot flies through.