DEV Community

Cover image for Cloning Flappy Bird from Scratch with Python
GIGO Dev
GIGO Dev

Posted on

Cloning Flappy Bird from Scratch with Python

Ever notice how recipe sites like to give a whole life story before telling you how to make your panini? Well when I was a young boy, my father, took me into the city to see a marching band. He said, “Son when you grow up, learn how to program but make it fun.” Then everyone clapped, true story.

Today we’re going to explore building a Flappy Bird clone from scratch using Python. This project and many other beginner-intermediate level projects can be found on GIGO Dev.

The benefits of learning game development

In 2013 Flappy Bird took the world by storm. When the game initially it was considered relatively unsuccessful until a review by youtuber PewDiePie.

Following that spark, the game organically grew until it topped the charts and was, according to core developer Dong Nguyen, earning $50,000/month from in-app advertisements. Initial design and development took Nguyen’s side scroller app from idea to reality in about 3 days.

$50k/month for 3 days of real work. Why don’t we all just become appstore game developers?

Following the dramatic tale of Flappy Birds rise, on February 8th, 2014 Nguyen went to Twitter exclaiming,

”I am sorry Flappy Bird users, 22 hours from now, I will take Flappy Bird down. I cannot take this anymore.”

In an interview with Forbes, Nguyen cited the game’s addictive nature for its cancellation, stating:

“Flappy Bird was designed to play in a few minutes when you are relaxed. But it happened to become an addictive product. I think it has become a problem. To solve that problem, it’s best to take down Flappy Bird. It’s gone forever.”

Nguyen said that the guilt that he felt over the game was affecting his sleep and that his conscience was relieved after he took down the game.

A real tragedy. This man was simply suffering from success.

30,000 foot view

Our Flappy Bird clone is a terminal-based game built from scratch using Python that is accessible via our online pre-configured IDE.

For context on what the final project should look like: The game features a bird controlled by the user, obstacles that the bird must navigate through, a scoring system, high score tracking, and real-time rendering.

The bird automatically moves from left to right, falls due to gravity, and rises when a key (e.g., spacebar) is pressed. The obstacles, or pipes, have gaps at random heights that the bird must navigate through. The user earns a point for successfully navigating through each set of obstacles.

The game ends when the bird collides with an obstacle or the ground, at which point the user’s score and whether or not they beat their high score is displayed. The high score is stored and accessed from a file locally, from inside of the project directory.

What you came here for

Here is where you can access the full comprehensive Flappy Bird tutorial: https://www.gigo.dev/challenge/1712955499307073536

Keep in mind, this version requires you to build the game up from scratch and should take about an hour if you are a newer programmer.

If you get frustrated along the way and give up, or just want to see what the final version of a Flappy Bird clone looks like inside of an IDE, we have a completed ready to run version of the game at your disposal: https://www.gigo.dev/challenge/1714021972238663680

Either way, there are resources, such as GIGO Dev’s Code Teacher, built into the platform to guide you to project completion.


Discord: https://discord.gg/learnprogramming
Twitter: https://twitter.com/gigo_dev
Reddit: https://www.reddit.com/r/gigodev/

GitHub repository: https://github.com/Gage-Technologies/gigo.dev

Get started on your first project at gigo.dev

Top comments (0)