Project 1: Flappy Bird Game
Project 1: Flappy Bird Game
FLAPPY BIRD
GAME
About Project:
■ It is one of the most addictive and played games for all. All the playing
methods are too simple. All you have to do is just try to stay in the
middle of the screen until long green pipes appear in front of you. Here,
the user has to control the bird flapping up, down using Spacebar, without
touching pipes in order to score game points. This means the more you
pass through green pipes, more will be the game points. The gameplay
design is so simple that user won’t find it difficult to use and navigate.
How do we create a project?
■ For this project, we are going to use the Virtual Studio Code IDE and the pygame
module. Pygame is a library that is used in creating games in Python. It has four
important things.
Game Loop
Events
Sprites
1. Sounds
Importing Random Module
• In the code given below. which is for the random() function, which generates random
numbers between 0 and 1.
Main Gameplay
In the main gameplay of a game.We are Creating 2 pipes for blitting on the screen.
Includes the list of upper and lower pipes. Checking for score function, Adding a
new pipe when the first is about to cross the leftmost part of the screen.
This module is for the welcome main screen
• In the code given below, which is for the function of welcome main screen. It shows
welcome images on the screen.
This module is for the get random pipes
• In the code given below, which is for the function of get random pipes. Generate positions
of two pipes(one bottom straight and one top rotated ) for blitting on the screen.
This module is for images
• In the code given below, which is for the function of images use in a game.
This module is for the sound
In the code given below, which is for the function of sound/audion use in a game
That’s how we are creating Flappy Bird Game in Python in our projects. We will also try to
expand and try different ways in implementing the Flappy Bird Game.