A two-player Pong game built in C++ using the raylib game library. Developed as a hands-on C++ project to practice game architecture, object-oriented design, and real-time game loop patterns.
- Two-player local multiplayer on a single keyboard
- Ball speed increases with each paddle hit, up to a configurable maximum, creating escalating difficulty
- Angle-based ball deflection — where the ball hits the paddle determines its outgoing trajectory
- First to 11 points wins, with a game-over screen and win sound effect
- Round timer with a short delay between points before the next round starts
- Custom warm color palette with pixel-art style paddle textures
- Sound effects for ball hits, scoring, and game win
- Locked at 60 FPS for consistent gameplay
- Object-oriented design with
PongGame,Player, andBallclasses - Game loop split into a
GameTick(logic) andRenderTick(rendering) for clean separation of concerns std::unique_ptrused throughout for safe memory management- Ball physics driven by velocity vectors with configurable speed constants (
InitialBallSpeed,MaxBallSpeed,BallSpeedStep) - Goal detection via a
std::functioncallback (OnGoal) decoupling the ball from game state - State machine managing
PreGame,MidGame, andEndGamephases - CMake build system with raylib fetched and built automatically as a dependency
| Player | Up | Down |
|---|---|---|
| Player 1 | W |
S |
| Player 2 | ↑ |
↓ |
Download the executable from the GitHub Releases page and run it — no install required.
Requires CMake 3.15+ and a C++17 compiler. raylib is fetched automatically.
cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release
cmake --build cmake-build-release- raylib — game library (zlib license)
- Win Jingle Sound CC0 — game win sound effect
