A C++ implementation of the classic Flappy Bird game using SDL2.
- Classic Flappy Bird gameplay
- Score tracking with high score persistence
- Sound effects
- Smooth animations
- Collision detection
brew install sdl2 sdl2_image sdl2_mixersudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev- Download SDL2 development libraries from https://www.libsdl.org/
- Install SDL2_image and SDL2_mixer libraries
- Configure your IDE to link against these libraries
Before running the game, you need to provide the following assets:
- img.png - A sprite sheet containing all game graphics
- sound/ directory with the following WAV files:
- win.wav (scoring sound)
- wing.wav (wing flap sound)
- vacham.wav (collision sound)
- roi.wav (falling sound)
- die.wav (death sound)
See README_ASSETS.md for detailed information about the required assets.
mkdir build
cmake -S . -B build
cmake --build build./FlappyBird- Space or Up Arrow: Make the bird flap
- Escape: Quit the game
- Press Space to start the game
- Use Space or Up Arrow to make the bird flap and avoid pipes
- Try to get the highest score possible
- Click the restart button when the game ends
main.cpp- Main game loop and logicBird.h/cpp- Bird class implementationWater_pipe.h/cpp- Pipe obstacle classCommonFunc.h/cpp- Common utility functionsmain.h- Main header file with includes
- Built with C++11 and SDL2
- Screen resolution: 288x512 pixels
- Uses sprite-based graphics
- Implements AABB collision detection
- Supports audio through SDL_mixer
- Ensure SDL2 development libraries are installed
- Check that pkg-config can find SDL2 packages
- Verify compiler supports C++11
- Make sure
img.pngexists in the game directory - Ensure all sound files are present in the
sound/directory - Check that sound files are in WAV format
This project is for educational purposes. Please respect copyright when using game assets.
