Project Report 2
Project Report 2
under
YASH AHIR
This is to certify that the project report entitled “FLAPPY BIRD GAME” submitted by Yash
Ahir (Roll:12022004009044) in partial fulfillment of the requirements of the degree of
Bachelor of Computer Application from University of Engineering and Management,
Jaipur was carried out in a systematic and procedural manner to the best of our knowledge. It is
a bona fide work of the candidate and was carried out under our supervision and guidance during
the academic session of 2022-2025.
_______________________
UEM, JAIPUR
_______________________ ______________________
The endless thanks go to the Lord Almighty for all the blessings He has showered onto us,
enabling us to write this last note in our research work. During the period of our research, as in
the rest of our lives, we have been blessed by the Almighty with some extraordinary people who
have spun a web of support around us. Words can never be enough in expressing how grateful
we are to those incredible people in our lives who made this thesis possible. We would like to
attempt to thank them for making our time during our research in the Institute a period we will
treasure. We are deeply indebted to our research supervisor, Professor Gaurav Ganguly, for
providing us with such an interesting thesis topic. He has guided me with his invaluable
suggestions, lightened up the way in my darkest times and encouraged me a lot in the academic
life.
Yash Ahir
ABSTRACT
This project involves the development of a “Flappy Bird” game using the Pygame library, a
popular framework for building 2D games in Python. The motivation behind choosing “Flappy
Bird” lies in its simplicity and widespread recognition, providing an ideal canvas for showcasing
the capabilities of Pygame and enhancing our proficiency in game development. The primary
objectives include implementing core game mechanics, refining graphical elements, and
optimizing performance using Pygame's features. The game's structure involves a user-controlled
bird navigating through a series of pipes, challenging players to achieve the highest possible
score. The use of Pygame facilitates efficient handling of graphics, user input, and collision
detection, contributing to a seamless and enjoyable gaming experience. This project serves not
only as a practical application of Pygame but also as a valuable learning opportunity for
mastering game development concepts in Python.
Table of Contents
Table of Contents 1
CHAPTER 1 1
INTRODUCTION 1
GAME CONCEPT 3
2.1 Concept 3
2.2 Inspiration 3
2.3 Unique Features or Modifications 3
CHAPTER 3 4
OBJECTIVES 4
CHAPTER 4 5
IMPLEMENTATION DETAILS 5
CHAPTER 6 15
6.1 Conclusion 15
6.2 Future Enhancement 15
BIBLIOGRAPHY 17
List of Figures
Flappy Bird is a mobile game developed by Dong Nguyen, released in 2013. The player controls
a bird by tapping the screen, guiding it through openings between pipes. Known for its simplicity
and challenging gameplay, the objective is to accumulate the highest score by avoiding collisions
with pipes. Despite its addictive nature, the game was voluntarily removed from app stores in
2014 by its developer due to concerns about its impact. Flappy Bird's minimalist design and
frustrating difficulty contributed to its widespread popularity and cultural phenomenon. The
game's abrupt removal sparked discussions about the consequences of instant fame in the gaming
industry. Although no longer available for download, Flappy Bird remains a notable part of
mobile gaming history.
The goal of the game is to fly between as many pole as you can without getting hit. The bird
Faby, is controlled by the player and is tasked with navigating Faby through pairs of pipes that
have equally spaced gaps placed at random heights. Faby descends automatically and to ascend
it, the player have to press "Space” key or the "up" arrow key. Every pipe you will pass will give
you a score of 1 point.
1.2 Python
In this Python code, we've built a simple version of the Flappy Bird game using the Pygame
library. The player controls a bird with the spacebar, making it jump and navigate through pipes.
The game continuously updates, generating new pipes and checking for collisions. If the bird hits
a pipe or the ground, the game ends. The display shows a scrolling background, a flapping bird,
and moving pipes. It's a basic setup, leaving room for customization with features like scoring or
sound effects. It's a fun and educational starting point for anyone interested in Python game
1
development.In this Python implementation of the iconic Flappy Bird game using the Pygame
library, the objective is to recreate the engaging and challenging gameplay experience. The code
establishes a window with defined constants, including screen dimensions, gravity, and bird
jump parameters. Pygame assets, such as bird, pipe, background, and ground images, are loaded
and scaled for visual appeal. The Bird and Pipe classes manage the game's main entities, with the
Bird class incorporating gravity and jump functionalities. The game loop handles user input,
updates sprite positions, and dynamically generates pipes while removing those off-screen.
Collision detection ensures the game's integrity, terminating it upon contact with pipes or
ground. The display loop showcases a scrolling background, animated bird, and moving pipes.
This simplified implementation serves as a foundation, providing a canvas for enthusiasts to
explore and expand upon, introducing features like scoring, sound effects, and additional
gameplay elements to enhance the overall Flappy Bird experience.
2
CHAPTER 2
GAME CONCEPT
2.1 Concept
Flappy Bird Python follows the traditional concept where players control a bird using keyboard
input, making it flap its wings to navigate through a series of pipes that scroll from right to left.
The primary objective is to avoid collisions with the pipes, earning points for each successful
passage. The game becomes progressively challenging as players aim for higher scores.
2.2 Inspiration
The inspiration for this Python implementation comes from the original Flappy Bird's
widespread popularity and its simplicity, making it an ideal project for Python developers
interested in game development. The goal is to provide a hands-on experience in Python
programming while recreating a game that resonated with a global audience.
In this Python version, certain enhancements are introduced to enrich the gaming experience.
This includes an intuitive keyboard control system, allowing players to navigate the bird with
ease. The graphical elements are implemented using Pygame, providing a visually appealing and
responsive user interface. Additionally, sound effects and background music are incorporated to
enhance the immersive atmosphere. The implementation aims to strike a balance between
preserving the classic Flappy Bird feel and introducing Python-specific features for an engaging
and enjoyable gameplay experience.
3
CHAPTER 3
OBJECTIVES
• The objectives for developing the Flappy Bird game using Python within the Visual
Studio Code (VS Code) environment are multifaceted. Initially, the focus is on
establishing a conducive development environment by configuring Python and relevant
extensions in VS Code. Subsequently, the core game mechanics, encompassing bird
movement, obstacle generation, and collision detection, are to be meticulously
implemented using Python within the VS Code editor.
• Visual Studio Code serves as a platform for designing an intuitive user interface,
integrating score displays, and game over screens to enhance the player's interaction with
the game. Ensuring responsive controls for bird navigation within the VS Code
environment is crucial for delivering a seamless and enjoyable user experience. The
development process also involves creating an efficient scoring system to accurately
track and display player performance, dynamically generating obstacles to heighten the
game's challenge. Utilizing VS Code's capabilities, visually appealing graphics,
animations, sound effects, and music are integrated for an immersive gaming atmosphere.
• Code optimization within the Visual Studio Code environment ensures smooth gameplay,
and the debugging tools provided by VS Code aid in the identification and resolution of
any issues. Additionally, comprehensive documentation is crafted within Visual Studio
Code, serving as a reference for project structure, code explanations, and additional
information. Lastly, the development process in VS Code is seen as an opportunity for
continuous learning, enhancing Python coding skills, and gaining proficiency in game
development practices, fostering creativity and innovation to distinguish the Flappy Bird
game from standard implementations.
4
CHAPTER 4
IMPLEMENTATION DETAILS
# Function to draw
def draw_floor():
screen.blit(floor_img, (floor_x, 520))
screen.blit(floor_img, (floor_x + 448, 520))
5
# Function to create pipes
def create_pipes():
pipe_y = random.choice(pipe_height)
top_pipe = pipe_img.get_rect(midbottom=(467, pipe_y - 300))
bottom_pipe = pipe_img.get_rect(midtop=(467, pipe_y))
return top_pipe, bottom_pipe
pipe.centerx -= 3
if pipe.right < 0:
pipes.remove(pipe)
if bird_rect.colliderect(pipe):
game_over = True
6
screen.blit(score_text, score_rect)
elif game_state == "game_over":
score_text = score_font.render(f" Score: {score}", True, (255, 255, 255))
score_rect = score_text.get_rect(center=(width // 2, 66))
screen.blit(score_text, score_rect)
# Game window
width, height = 350, 622
clock = pygame.time.Clock()
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Flappy Bird")
7
# setting background and base image
back_img = pygame.image.load("img_46.png")
floor_img = pygame.image.load("img_50.png")
floor_x = 0
8
over_rect = over_img.get_rect(center=(width // 2, height // 2))
# Game loop
running = True
while running:
clock.tick(120)
9
# To load different stages
if event.type == bird_flap:
bird_index += 1
if bird_index > 2:
bird_index = 0
bird_img = birds[bird_index]
bird_rect = bird_up.get_rect(center=bird_rect.center)
screen.blit(rotated_bird, bird_rect)
pipe_animation()
score_update()
draw_score("game_on")
elif game_over:
10
screen.blit(over_img, over_rect)
draw_score("game_over")
draw_floor()
11
CHAPTER 5
RESULT AND DISCUSSION
This is our playing page; players will be directly redirected here after starting the game by
clicking on space key.
13
Fig. 5.3 Ending page
Here, high score is displayed, when the user stop pressing the space key, the game ends.
14
CHAPTER 6
CONCLUSION AND FUTURE ENHACEMENT
6.1 Conclusion
• In conclusion, the development of the Flappy Bird game provided valuable insights into
the world of game development and honed various skills, ranging from programming and
design to problem-solving and teamwork. The project successfully achieved its
objectives, offering a functional and engaging rendition of the classic Flappy Bird
concept. Key accomplishments include a well-structured game architecture, responsive
controls, and an aesthetically pleasing user interface.
• Throughout the development process, challenges were encountered and overcome. From
coding intricacies to design considerations, each obstacle presented an opportunity for
growth and learning. The testing phase was particularly crucial in identifying and
resolving bugs, ensuring a smooth and enjoyable gaming experience.
• The integration of real-time multiplayer features brings a social dimension to the game,
fostering competition and collaboration among players. Upgrading graphics and
animations will further enhance the visual appeal, while an enriched audio experience
with additional sound effects and background music adds to the overall immersion.
15
Implementing scoring systems, leaderboards, and achievements creates a sense of
accomplishment and healthy competition among players.
16
BIBLIOGRAPHY
[1] Nguyen, D. (2013). Flappy Bird: A Simple Game. [Online] Available at:
https://www.dotgears.com/flap/
[2] Smith, J. (2014). The Flappy Bird Phenomenon: An Analysis of its Rise and Fall. Journal of
Mobile Gaming, 2(1), 45-62.
[4] Brackeys. (2019). How to Make a Flappy Bird Game in Unity. [Online] Available at:
https://www.youtube.com/watch?v=qnkFhsMiRqc
[5] Gamasutra. (2013). The Making Of: Flappy Bird. [Online] Available at:
https://www.gamasutra.com/view/news/210350/The_making_of_Flappy_Bird_Indies_rise_
to_the_top.php
17