# Scratch Flappy bird tutorial

Ever wanted to learn how to make your own flappy bird game?

Always thought it was hard? It isn’t!

Let me show you how to make it using Scratch in under 10 minutes! It will look something like this:

![](https://substackcdn.com/image/fetch/$s_!TOVw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b261be6-ce01-4e2d-ab2b-cf5a8e046a0c_956x720.png align="center")

You can play it here: [Flappy Banana](https://scratch.mit.edu/projects/1183025386/) if you want to test it, and if you want to see something more advanced that I made (took more time) check out [Rocket Cube on Scratch](https://scratch.mit.edu/projects/1176933226/) .

Scroll down for the steps:

1.  Make a new scratch project
    

Go to scratch. If you don’t have an account, sign up for one. It’s free! At the top of the page, there is a button that says ”Create” next to the logo. Click it. It should look something like this:

![](https://substackcdn.com/image/fetch/$s_!pgA_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12ad3c93-eca5-45fe-8dad-461c5486c3a6_1600x904.png align="center")

Looks like that? Good. Name it.

2.  Art
    

Now press “Costume” (Below the logo) and paint something like a bird, a dragon, an airplane, a rocket, it could be anything! If you want it to animate, make multiple costumes. I will make a flying banana:

![](https://substackcdn.com/image/fetch/$s_!Brz3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe13020a-8ad1-49b5-acf7-9e063f32a1d0_1600x891.png align="center")

Looks good, but the banana is WAY too big in the preview on the right. We can fix that though. WITH CODE!!! Switch back to the code tab and put in this code:

![](https://substackcdn.com/image/fetch/$s_!Cq7G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb38fbb6-9588-441b-9ecc-d5e20530b238_1600x891.png align="center")

This should make it smaller. Feel free to play around with the size! Ok, now click the purple button in the bottom right corner. THE ONE WITH THE CAT. This is important.

![](https://substackcdn.com/image/fetch/$s_!PfDk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b9553ad-5ebc-491b-95f7-406327ccd7a5_510x448.png align="center")

Press the search button. You should see some things. Choose the one that looks the most like a pipe or zapper or mountain. If it looks weird, change it. I chose a building.

3.  Code buildings
    

Click on the building. Add this code:

![](https://substackcdn.com/image/fetch/$s_!YmO0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F107f4eda-5ef5-4077-bfb6-5a6e7a15b206_806x554.png align="center")

Ok, the buildings are working fine.

“But, Asher,” you ask. “The buildings don’t vary in height and they cluster at the left!” Add this code:

![](https://substackcdn.com/image/fetch/$s_!NGNL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40633bc4-ca90-4588-9b6a-c81ec1950111_880x1230.png align="center")

Run the program. It should work.

4.  Player movement
    

Click on your player. Make a variable called SpeedY and add this code:

![](https://substackcdn.com/image/fetch/$s_!P1Ww!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a473d24-4c51-437a-94cb-30f2cc1ac715_726x1204.png align="center")

Ok, now when you press space your banana (or something else) flys up, but you can crash yourself into buildings with no consequences. Let’s fix that.

5.  Lives and Game Over
    

Add a variable called “LIVES” and this code to the player:

![](https://substackcdn.com/image/fetch/$s_!D6pF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcd502c7-2288-491b-ae7f-ad5ef32b1f21_894x962.png align="center")

The code below is for the building.

![](https://substackcdn.com/image/fetch/$s_!5Xsy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1847a207-b4c6-48d6-a0d1-3d619e93e03b_1004x936.png align="center")

The game works! But why stop here…

6.  Challenges for experienced coders
    
    1.  Try adding points
        
    2.  Add a second player
        
    3.  Make it so you can move forward and back too.
        
    4.  animate!
        

Comment your submissions at [Flappy Banana Submissions](https://scratch.mit.edu/studios/50585883/) (Mine is animated)

Some other games I made are under the profile [NoomKlaw](https://scratch.mit.edu/users/noomklaw/) on Scratch to play too!

> IDK how this works...
> 
> ***\-Guy the Lizard***
