A re-creation of the classic Flappy Bird game, built with C++ and the Raylib game programming library. This project aims for a simple, fast, and fun experience, showcasing game development in C++ with modern tooling.
These instructions will get you a copy of the project up and running on your local machine.
You'll need the following installed on your system:
- A C++ compiler that supports C++20 (e.g., GCC 10+, Clang 10+, MSVC 19.29+).
- CMake (version 3.10 or higher).
- Raylib development libraries.
- Linux (e.g., Ubuntu/Debian):
sudo apt install cmake g++ libraylib-dev - macOS:
brew install cmake raylib - Windows: Install CMake and a C++ toolchain (like MSVC with Visual Studio Community or MinGW-w64). Raylib can be installed via
vcpkgor by downloading precompiled binaries and setting up your environment variables. Refer to the Raylib Wiki for detailed Windows setup.
- Linux (e.g., Ubuntu/Debian):
-
Clone the repository:
git clone https://github.com/ph8n/flappybird.git
-
Navigate to the project directory:
cd flappybird -
Create a build directory and configure CMake: It's standard practice with CMake to build out-of-source.
mkdir build cd build cmake .. -
Build the game: This command will compile the project using the build system generated by CMake (e.g., Makefiles on Unix, Visual Studio solutions on Windows).
cmake --build . -
Run the game: The executable will be located in the
builddirectory (or a subdirectory likebuild/Debug/on Windows)../flappybird
(On Windows, it might be
.\Debug\Flappybird.exeor.\Release\Flappybird.exedepending on your build type).
- Launch the game using the installation instructions above.
- Press the arrow up or click to make the bird flap its wings and go higher.
- Navigate the bird through the gaps in the pipes to score points.
- Avoid colliding with the pipes or the ground.