Scratch is a great tool for kids to learn how to code and it’s completely free! Anyone can use Scratch to make fun games, stories, and animations by dragging and dropping different blocks of code. It’s really easy to use and perfect for beginners who want to be creative and solve problems with coding.
Make a Flappy Bird Game Using Scratch
- Login to Scratch
- Create a New Project
- Name Your New Project
- Choose a Backdrop
- Choose a Sprite
- Resize and position the sprite
- Add the first code block
- Set the sprite’s starting position
- Add gravity to the game
- Make gravity slower
- Make the bird fly up
- Design the Game’s Obstacle
- Animate the Obstacle
- Randomly Position the Obstacle
- End the Game Upon Collision
- Test your game!
1. Login to Scratch
- Go to scratch.mit.edu and either login or sign up.

2. Create a New Project
- Once you are logged in, click the blue Create button at the top of the page.

3. Name Your New Project
- Give your project a name, for example, “Flappy Bird Game”.
- Then delete the Scratch cat by clicking the trash can icon next to the sprite.

4. Choose a Backdrop
- Select the Choose a Backdrop option at the bottom right-hand side of your screen.

- When the Choose a Backdrop screen opens up, select a background for your Flappy Bird game. In this tutorial, I chose “Jungle”, but you can choose whatever you’d like!

5. Choose a Sprite
- Then, go to the Choose a Sprite option, which is next to the “Choose a Backdrop” section.

- Select a bird sprite of your choosing. We selected the Parrot sprite, which is suggested if you want to create a flapping motion for the character.

6. Resize and position the sprite
- Resize your sprite by changing the Size textbox, we changed it to 50 in this tutorial.
- Then, click and drag the sprite shown to the left of the game, since the pipes will be moving from the right to the left.

7. Add the first code block
- Go to the Events category, then click and drag a when green flag clicked events block into your code area.

8. Set the sprite’s starting position
- Go to the Motion category and drag a go to x and y block under your when green flag clicked block. This will make sure the player begins at the same place every time the game is loaded.

9. Add gravity to the game
- Then, in the Control block category, drag a forever block and attach it under the go to x and y block.

- Go back up to the Motion category and get a change by y motion block, then drag it directly into the forever block.
- Change the value in the textbox of the change by y block to -15. Now when you press the green flag icon above your game, the bird will drop really fast!

10. Make gravity slower
- To fix the bird from falling so quickly, put a wait block from the Control category before the change y by block.
- Change the value in the textbox to about 0.1.

11. Make the bird fly up
- Now let’s make it so the player can interact with the game! Grab a when space key pressed block from the Events category and drag it into the code area.

- Go to the Motion category and get a change y by block and put it below the when space key pressed block. Now the player can make the bird fly up! NOTE: Check out the bonus after this tutorial which will show you how to make the bird’s wings flap as they fly.

12. Design the Game’s Obstacle
- Click on the paint option from the New Sprite button to create a pipe sprite.

- Select a color of your choice from the Fill option, then select the square from the list of tools.

- Click and drag the square to create two pillars or tubes that will be obstacles for the game. Reposition and resize the pipes as needed.

13. Animate the Obstacle
- Click on the Code tab and drag a when green flag clicked block from the Events category into the code area. Attach a forever block from the Control category.

- Next, go the the Motion category and drag a set y to block, set x to block, and a glide to x and y block inside the forever block.
- In the set x to block, change the textbox to say 275. This makes it so the pipes will start on the right side of the screen!

- Update the glide block to glide for 2 seconds and change the x value to -275, so that it moves to the left of the screen.
- Then, in the Motion category, drag a y position block inside of the y value in the glide block.

14. Randomly Position the Obstacle
- Test your project, you’ll notice that the pipes stay at the same position every time they move toward the player.
- To fix this, go to the Operators category and grab a pick random block and drag it into the set y to block.
- Change its values to something like -65 and 65.

15. End the Game Upon Collision
- Nothing happens when the parrot collides with the pipe! Let’s get a when green flag clicked block from the Events category and a forever block from the Control category to set this up.

- From the Control category, get an if then block and put it inside the forever block.

- Then, go to the sensing category and get a touching mouse-pointer block. Drag that into the if then block.
- Click the mouse-pointer option to change it to Parrot instead

- Go to the Control category and get a stop all block and put that inside the if then block. This will stop the game when the Parrot and pipes collide!

16. Test your game!
- The game should stop when the bird collides with the pipes. Check out the completed project here.

Bonus 1 – Adds a points system
1. Create a variable
- In your Flappy Bird Project, go to the Variables category and right-click on the variable called my variable. It’s right below the Make a Variable button.
- Then, select the Rename Variable option.

2. Name the variable
- In the popup window, type score for the name, then click OK.

3. Display the Score
- Then, click the checkbox next to the score variable. This makes the score show up in your game.

4. Update the score
- Then, in the Variables category, drag a set score to 0 block right under the when green flag clicked block.
- Also get a change score by 1 block and put it under the glide block.

5. Test the game!
- Test your game, you should be able to get a score now when you play the game
Bonus 2 – Make the bird’s wings move as you play the game
1. Select the Sprite
- First, make sure you click the Parrot sprite from the sprites list.

2. Switch the Sprite’s costume
- Go to the Looks category and grab a switch costume block for inside the forever block and under the when space key pressed block.
- Make sure that you are using parrot-a in the forever block and parrot-b under the when space key pressed block.

3. Test the Game
- Do your Parrot’s wings flap? Then, your project is complete, great job!

2 Comments