An open API service indexing awesome lists of open source software.

https://github.com/theoddysey/flappy-bird-python

Flappy Bird Game using Pygame
https://github.com/theoddysey/flappy-bird-python

game game-development python simulation

Last synced: about 1 year ago
JSON representation

Flappy Bird Game using Pygame

Awesome Lists containing this project

README

          

# Flappy Bird Game using Pygame

Flappy Bird is a classic and addictive game recreated in Python using the Pygame library. This project provides a step-by-step guide on how to build your own Flappy Bird game from scratch.

## Game Setup
Before you can play the game, you need to set up your environment and install the necessary dependencies. Make sure you have Python and pip installed. Then, follow these steps:

1. Clone this repository to your local machine.

```bash
git clone https://github.com/yourusername/flappy-bird-pygame.git
```

2. Navigate to the project directory.

```bash
cd flappy-bird-pygame
```

3. Install the required Python packages using pip.

```bash
pip install pygame
```

4. Run the game.

```bash
python main.py
```

## Creating the Game World
The game world is created using classes and components that define the bird, pipes, and game logic. You can explore the `main.py`, `world.py`, `bird.py`, `pipe.py`, and `game.py` files to understand how the game world is implemented.

## Adding Game Components
- `bird.py`: Contains the Bird class, which represents the player character. It handles the bird's animation, movement, and collision detection.

- `pipe.py`: Contains the Pipe class, responsible for the creation and management of pipe obstacles. Pipes are generated dynamically to create a challenging gameplay experience.

- `world.py`: Defines the World class, which manages the game world, including scrolling the background, applying gravity to the bird, and handling collisions and scoring.

- `game.py`: Provides the GameIndicator class, responsible for displaying the player's score and game instructions on the screen.

## Running the Game
Once you've set up the game, you can run it using the provided `main.py` script. Use the following command:

```bash
python main.py
```

## Controls
- Press the SPACE key to make the bird jump.
- Press the 'R' key to restart the game after a game over.

## Contributing
Contributions are welcome! If you'd like to improve this project or add new features, please fork the repository and create a pull request. You can also open issues for bug reports or feature requests.