https://github.com/wxx9248/flappybird.cpp
Flappy Bird C++ Implementation
https://github.com/wxx9248/flappybird.cpp
cpp flappy-bird game sdl2
Last synced: about 2 months ago
JSON representation
Flappy Bird C++ Implementation
- Host: GitHub
- URL: https://github.com/wxx9248/flappybird.cpp
- Owner: wxx9248
- License: gpl-3.0
- Created: 2019-03-19T16:26:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-26T09:55:19.000Z (6 months ago)
- Last Synced: 2025-08-11T04:28:22.469Z (about 2 months ago)
- Topics: cpp, flappy-bird, game, sdl2
- Language: C++
- Homepage: https://github.com/wxx9248/FlappyBird.cpp
- Size: 71.2 MB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FlappyBird.cpp
A modern C++ implementation of the classic Flappy Bird game using SDL2.
## Description
This project is a reimplementation of the Flappy Bird game using C++23 and SDL2. The game features smooth animations,
sound effects, and a familiar gameplay experience.## Features
- Modern C++23 standard
- Cross-platform compatibility using SDL2
- Smooth animations with frame rate stabilization
- Clean object-oriented design
- Multithreaded game logic for better performance
- Score tracking and medals## Dependencies
- C++23 compatible compiler
- SDL2
- SDL2_image
- SDL2_mixer
- SDL2_ttf
- CMake 3.20 or higher## Building
### Linux/macOS
To build the project on Linux or macOS, follow these steps:
```bash
mkdir build && cd build
cmake ..
make
```### Windows with vcpkg and Visual Studio
#### Install required packages:
```cmd
vcpkg install
```#### Generate Visual Studio project:
```cmd
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" -DCMAKE_GENERATOR_PLATFORM=x64
```#### Open the generated .sln file in Visual Studio and build the project, or build from command line:
```cmd
cmake --build . --config Release
```## Running
### Linux/macOS
After building, you can run the game from the build directory:
```bash
./FlappyBird
```### Windows
After building, you can run the game from the build directory:
```cmd
.\Release\FlappyBird.exe
```## Controls
- Press Space or Up Arrow to make the bird flap its wings
- Press M to toggle mute
- Press Escape to quit the game## Project Structure
The project is organized into several modules:
- `core`: Core game functionality (game loop, resource management)
- `game`: Game entities (bird, pipes)## License
[MIT License](LICENSE)