0% found this document useful (1 vote)
615 views

Project 1: Flappy Bird Game

The document describes creating a Flappy Bird game using Python. It discusses using the Pygame module to handle game elements like sprites, sounds, and the game loop. The code imports necessary modules like random, pygame, and sys. It defines global variables and functions for welcoming the player, generating random pipes, displaying images and playing sounds. The main gameplay involves creating and blitting two pipes on the screen, checking for collisions and scoring, and adding new pipes as the first ones pass off the left side to create an endless flying experience for the player to try navigating between pipes as long as possible.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
615 views

Project 1: Flappy Bird Game

The document describes creating a Flappy Bird game using Python. It discusses using the Pygame module to handle game elements like sprites, sounds, and the game loop. The code imports necessary modules like random, pygame, and sys. It defines global variables and functions for welcoming the player, generating random pipes, displaying images and playing sounds. The main gameplay involves creating and blitting two pipes on the screen, checking for collisions and scoring, and adding new pipes as the first ones pass off the left side to create an endless flying experience for the player to try navigating between pipes as long as possible.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

PROJECT 1:

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.

Importing Pygame Module


• In the code given below, which is pygame library is an open-source module for the
Python programming language specifically intended to help you make games and other
multimedia applications. Pygame can run across many platforms and operating systems.
(Flappy Bird Game in Python with Source Code)

Importing Sys Module


• In the code given below, which is for the function of sys module. We will use sys.exit to
exit the program.
The actual code
This module is for the global variables
■ In the code given below, which is for the global variables for the game.

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.

You might also like