Skip to content

jafarbekyusupov/flappy-bird-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐦 Flappy Bird Clone

A Python implementation of the classic Flappy Bird game using Pygame

Tip

Explore the complete project overview, including UML Diagrams and in-depth explanations, provided by Cognition here.


Flappy Bird Demo


🚀 Features

• Smooth animations and physics (Bird wing movements using sprites)

Score tracking system and Leaderboard implementation for Top Scores, storing data in .json format

• Pause/resume functionality

• Responsive UI with buttons

• Size selection menu (Small, Medium, Large)

🕹️ How to Play

• Press Space to make the bird flap and avoid pipes

• Try to fly through the gaps between pipes to score points

• To Pause the Game - Press P key or double-click the left mouse button

• The game ends when you hit a pipe or the ground

• After game over, click "Play Again" to restart

• If your score is high enough, an input box will appear — enter your name to be featured on the leaderboard

📜 Gameplay Showcase

⚙️ Installation

  1. 📥 Clone the repository:
    git clone https://github.com/jafarbekyusupov/flappy-bird-py.git
    cd flappy-bird-py
    
  2. 🐍 Create a virtual environment and activate it:
    python -m venv venv
    source venv/bin/activate  # On Windows use `venv/Scripts/activate`
  3. 📦 Install dependencies:
    pip install -r requirements.txt # On Windows if pip is not recognized:  try py -m pip install -r requirements.txt
  4. 🕹️ Run the game:
    python code/main.py
    

🏗️ Project Structure

flappy-bird/
├── game/  
│ ├── main.py ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎  # Entry point that initializes and runs the game                                            
│ ├── settings.py‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎  # Game settings and configuration                                                            
│ ├── game.py‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎  # Main game logic and loop controller                                                        
│ ├── bird.py‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎  # Bird class handling player character behavior                                                    
│ ├── pipes.py‎‎ ‎ ‎ ‎ ‎ ‎ ‎  ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎   # Manages pipe creation, movement and collision                                                
│ ├── interface.py‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎   # Handles UI elements including buttons and overlays                                                            
│ ├── score_system.py‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎    # Manages score tracking and display                                                                       
│ ├── leaderboard.py‎‎             # LeaderboardButton button for Main Menu Screen to view leaderboard
│ 
├── testing/                 
│ ├── bird-test.py               # Unit testing for Bird object from code/Bird.py
│‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎                                                
├── assets/‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎  # Game assets folder                                                                                                                                                
│ ├── img/‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎     # Image assets                                                              
│
├── gameplay/
│ ├── gameplay.mp4                   # Gameplay Demo in Video Format
│ ├── game-Start-Screen.png          # Game Start Screen
| ├── game-getReady-screen.png       # Get ready Screen with 3 second countdown 
| ├── game-Pause-screen.png          # Game Pause Screen
| ├── gameOver-screen.png            # Game Over Screen
│ ├── game-Leaderboard.png           # Leaderboard
│
├── requirements.txt
├── gameplay.md                  # Screenshots and video showcasing the Gameplay
└── README.md‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎  # This file                                          

About

A Python implementation of the classic Flappy Bird game using Pygame

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages