How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (2024)

  • Pallabi Mohanty
  • July 26, 2022

Updated By

Rahul Lath

Reviewed By

Nipun Bindal

Contents

Create Flappy Bird: Scratch games are visually fun and interactive ways of learning coding and game development, especially for children between the ages of 8 to 16. A Catcher game on Scratch can be of different types depending on the sprite’s movement, objective, and rewards. In this blog, we will discuss how to make a flappy bird game on Scratch.

Looking to learn Scratch coding? Explore Wiingy’s Online Scratch Coding Classes For Kids to learn from top Scratch coding experts.

What is a Flappy bird game on Scratch?

In the Flappy Bird game on Scratch, you build moving pillars, control the bird’s movement with the space key, and every time the bird files through the moving pillars, you get points. There are five steps involved in making a Flappy Bird game, and they are listed below:

  1. Make a flappy motion sprite [bird]
  2. Add the pillars sprite [that the bird will fly through]
  3. Make the pillars move across the screen
  4. Make a background [end of the game]
  5. Keep score

This is Chapter 2.2 in the
Scratch Game Tutorial

How to make a Flappy bird game on Scratch in 9 minutes?

The detailed step-by-step process involved in making a Flappy bird game on Scratch is explained below:

Step 1: Make a Flappy motion sprite [bird]

The detailed steps on how to create a flappy bird game on Scratch are explained below;

The first step toward creating the flappy bird game on Scratch is to make the object move. For that, we will have to choose the right sprite, and the detailed steps on how to do this are outlined below:

  • Delete the Cat sprite
  • Click on the delete icon.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (2)
  • Let’s make a backdrop, click on “Backdrops”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (3)
  • Click on the “Convert to Bitmap”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (4)
  • Click on the “fill” from the paint tool.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (5)
  • Click on “Fill” and select the color.
  • Select the color by dragging the “Color”, “Saturation” and “Brightness” sliders as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (6)
  • Click on the paint area.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (7)
  • Backdrop color added.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (8)
  • Click on the “Code”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (9)
  • Pick a character for the game. Let’s add a bird sprite.
  • Click here to download the bird sprite.
  • Click on the “Download”.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (10)
  • Bird sprite (image) downloaded.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (11)
  • Click to open the saved folder of bird sprite.
  • Click on the “Show in folder”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (12)
  • Your sprite is saved in the “Downloads” directory; It may differ for you.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (13)
  • Now, upload the sprite to the game.
  • Click on the “Upload Sprite”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (14)
  • Search bird sprite in your downloads directory and click on it.
  • Then click on “Open”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (15)
  • The bird sprite was added to the game. Change the size of the bird sprite to make sure the bird is small enough to fly through the pillars.
  • Change the size to 50
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (16)
  • Make the bird the “flappy” motion. In Scratch, you can move the sprite up & down words by changing the Y value.
  • Drag & drop the “change y by” block and change the number.
  • Click on it as shown below. The bird can move upwards.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (17)
  • Create a variable to keep track of the Y position of the bird. And we will call it gravity.
  • Click on “Variables” and click on “Make a Variable”.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (18)
  • Name your variable
  • Click on the “Ok”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (19)
  • Drag & drop the “set gravity to” block as shown below and set the number zero.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (20)
  • From “Variables” drag the “gravity” variable & drop it to the “change y by” block.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (21)
  • Make the bird fall down. So change the value of gravity.
  • Drag & drop the “change gravity by” block and set the value to negative as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (22)
  • Drag & drop a forever loop as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (23)
  • Set the bird’s position when the game starts.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (24)
  • Drag & drop the “when green flag clicked” block on top as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (25)
  • Click on the “green flag”.
  • The bird is falling down.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (26)
  • The flappy motion is controlled by the space bar: each time you hit the space bar the bird goes up. We want the condition for the if statement to be the Sensing block “when space key pressed”.
  • Drag & drop the “if-then” and “key space pressed? then” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (27)
  • We want the bird to go up. Change the gravity variable value to a positive number.
  • Drag & drop the “set gravity to” block and change its value by 10; you can choose any.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (28)
  • To check this condition, again and again, drag & drop the forever loop as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (29)
  • Drag & drop the “when green flag clicked” block on top as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (30)
  • Click on the “green flag”.
  • The bird go up when the space bar key is pressed.
  • But if you keep pressing the space bar key bird keeps going upwards and overshoots the scratch stage area.
  • Add a conditional statement to avoid this.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (31)
  • Write a conditional statement to check whether the “space key” is not pressed.
  • Drag & drop the “wait until” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (32)
  • Drag & drop the “not” operator to the “wait until” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (33)
  • Drag & drop the “key space pressed” block to the “not” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (34)
  • Click on the “green flag”.
  • If you keep pressing the “Space key” the bird is not overshooting the scratch stage.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (35)

Step 2: Add the pillars sprite [the bird will fly through]

  • Create the pillars that the bird will fly through.
  • Click here to download the pipe sprite.
  • Click on the “Show in folder”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (36)
  • Now, upload the pipe sprite.
  • Click on the “Upload Sprite”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (37)
  • Search your downloaded pipe sprite in your download directory.
  • Click on it and click on the “Open”.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (38)
  • Pipe sprite added. Let’s modify it.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (39)
  • Click on the “Costumes”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (40)
  • Click on the “Convert to Vector”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (41)
  • Click on “Select” from paint tools.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (42)
  • Click on the pipe
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (43)
  • Make a duplicate of the pipe sprite.
  • Press “Ctrl + c” and then press “Ctrl + v”.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (44)
  • Click on the duplicated “pipe” then click on the “Flip Vertical”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (45)
  • Arrange both “pipe” sprites as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (46)
  • Click on the “Code”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (47)

Step 3: Make the pillars move across the screen

  • Let’s make these pipes and move them from right to left. Also, create multiple duplicates of these pipes.
  • Drag & drop the “create a clone of myself” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (48)
  • Add some delay to the code so that each clone will create every second.
  • Drag & drop “wait seconds” and “forever” blocks as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (49)
  • Drag & drop “when green flag clicked” block on top as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (50)
  • In Scratch, you can program the clone of any sprite.
  • Drag & drop the “when I start as a clone” block.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (51)
  • Make pipe sprite move from right to left. In Scratch, we can do this by changing the sprite’s X value with a negative number.
  • Also, write a conditional statement to check whether the sprite is reached at the left edge of the scratch stage.
  • Change the pipe sprite’s X value till the pipe sprite touches the left edge of the scratch stage.
  • Drag & drop the “repeat until” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (52)
  • Drag & drop the “less than”, and the “x position” block as shown below.
  • Change the “less than” block value by -240.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (53)
  • Drag & drop the “change x by” block as shown below
  • Change the “change x by” value with a negative number; this number will be the speed of the pipes (obstacle for the bird) movement.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (54)
  • Click on the “green flag”.
  • Pipi is moving from right to left. But stuck at the scratch left stage edge.
  • Let’s delete it once touches the left scratch stage edge.
  • Drag & drop the “delete this clone” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (55)
  • Also, hide the pipe sprite when the game starts and then show the pipe sprite when starting the clone.
  • Drag & drop the “hide” & “show” blocks as shown below and set the start point when starting as a clone.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (56)
  • Drag & drop the “go to x y” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (57)
  • Click on the “green flag”.
  • Pipes are coming from right to left but all pipe sprites are coming from the same height to enhance the game let’s make it random.
  • Drag & drop the “pick random to” block to the “go to x y” block as shown below.
  • Set the “go to x y” block’s y number -100 to 100.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (58)
  • Click on the “green flag”.
  • Pipes are now coming from right to left at a random height.

Step 4: Make a background [end of the game]

Let’s make a background for the end of the game.

  • Click on the sprite’s “Paint”.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (59)
  • Click on the “Convert to Bitmap”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (60)
  • Click on the “Fill” and select the black color.
  • Click on the “Fill” tool.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (61)
  • Click on the paint area.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (62)
  • Click on the “Convert to Vector”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (63)
  • Click on the “Text” tool
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (64)
  • Click on the “Fill” and select the red color.
  • Click on the “Text” tool and click on the paint area.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (65)
  • Write a message for the end of the game [here, Game Over!].
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (66)
  • Change the sprite name.
  • Change the position of the sprite, set the value (x, y) = (0, 0)
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (67)
  • Click on the “Code”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (68)
  • Hide the game over sprite when the game start.
  • Drag & drop “when green flag clicked” and “hide” blocks as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (69)
  • To show the “game over” sprite on the game over message, let’s add a message receive block.
  • Drag & drop “when I receive message1” block and select “New message”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (70)
  • Type the message for the end of the game.
  • Click on “Ok”
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (71)
  • Drag and drop the “When I receive the Game Over” message then it’ll show the “game over” sprite and stop the flappy bird game.
  • Drag & drop “show” and “stop all” blocks as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (72)
  • Click on the “bird” sprite.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (73)
  • End the game if the bird touches the pipe sprite.
  • Write a conditional statement to check whether the bird touches the pipe sprite.
  • Drag & drop “if-then” and “touching” blocks as shown below and click on the dropdown and select “pipe” sprite.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (74)
  • Let’s broadcast a game-over message.
  • Drag & drop the “broadcast Game Over” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (75)

Step 5: Setting the score

  • Let’s add a score to the game.
  • Create a variable to keep track of the score.
  • Click on the “Variables” then click on “Make a Variable”.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (76)
  • Name the variable.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (77)
  • Set the score to zero when the game start.
  • Drag & drop “set score to” block as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (78)
  • Click on the “pipe” sprite.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (79)
  • Increase the score when the bird successfully passes the pipe sprite.
  • Drag & drop the “change score by” block and change the number by 1 as shown below.
How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (80)
  • Click on the “green flag”.
  • Now, the score increases on each successful pipe sprite cross.

Time to Play!

  • Congratulations, you have completed the Flappy bird game in Scratch!
  • Click on “green flag” to start playing the Flappy bird game. What are the enhancements to the game you can think of? Do let us know in the comments section below.

Looking to learn Scratch coding? Explore Wiingy’s Online Scratch Coding Classes For Kids to learn from top Scratch coding experts.

Frequently asked questions (FAQs)

What is the flappy bird game on Scratch?
The flappy bird on Scratch is where the bird flies through a bunch of pillars all the while avoiding touching the pillars. If the bird touches the pillars then it is game over.

What is the easiest game to create a Scratch?
Some of the easiest games to create on Scratch are maze games, dodging games, platform games, and puzzle games.

What is the most popular game on Scratch?
The most played game of Scratch is Paper Minecraft v11.6 (Minecraft 2D) with over 35000 hearts.

What is the funniest game on Scratch?
There are many fun games you can make on Scratch like Flip 3D, Pokemon, Random tycoon thing, Fortnite Z, Old western way, Ball blast, and many more.

What are the steps to create the flappy bird game on Scratch?
Follow the steps mentioned below to create a flappy bird game on Scratch:

  1. Make a flappy motion sprite [bird]
  2. Add the pillars sprite [that the bird will fly through]
  3. Make the pillars move across the screen
  4. Make a background [end of the game]
  5. Keep score

Want to create more fun games on Scratch? Read our other Scratch game blogs like knife game, snake game, pong game, and many more!

Book a Free Lesson

Related Posts

How to Run a Scratch Program? – Execute Scratch Code

Run a Script in Scratch Programming: Scratchis built essentially for children who are interested in coding and game development. It is a visual programming language

How to Make a Sprite Jump in Scratch?

If you enjoy using Scratch to create programs or play different Scratch games, then learning how to make your sprite jump is an important skill

Where Can I Find the Source Codes for Scratch? [Links to Source Codes for Scratch 3.0, 2.0, and 1.4]

Source Codes for Scratch: Scratch has a simple, intuitive interface that allows users to drag and drop blocks of code to create programs. It is

How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (86)

Wiingy provides 1-to-1 online tutoring, instructor-led online technology courses, and web tutorials to school students, university students, and working professionals across the globe.

Download our App!

How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (87)

Learn

  • Math Tutorials
  • AP Statistics Tutorials
  • Python Tutorials
  • R Studio Tutorials
  • SolidWorks Tutorials
  • C++ Tutorials
  • Scratch Tutorials

Resources

Tools

  • Studio
  • Conversion Calculators
  • Color Picker
  • Factor Tree Calculator

STEM Guides

  • Robotics Guide
  • Scratch Guide
  • BBC micro:bit Guide

eBooks

  • Introduction to Scratch Programming
  • Coding For Kids
  • Robotics For Kids
  • Microbit Basics
  • Minecraft Coding for Kids
  • NAPLAN Guide

Wiingy does not employ any tutor and is not responsible for the conduct of any user of our site. Information in member profiles, job posts, applications, and messages is submitted by users of our site and may not be generated or verified by Wiingy. You need to do your own diligence to ensure the job or tutor you choose is appropriate for your needs and complies with applicable laws.

How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (90)

Copyright Wiingy Pvt Ltd © 2021-2023. All Rights Reserved

How To Code a Flappy Bird Game on Scratch? - Free Tutorial - Wiingy (2024)

References

Top Articles
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 5867

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.