A Pong clong build in C++ using the Raylib game programming library. This project is part of my practice learning C++ and to update its organization and factoring as if it were a large scale production game.
- Classic Pong Gameplay (player vs. CPU)
- Player and CPU paddles with collision detection.
- Scoreboard system (first to 3 points wins).
- Multiple game states (Main Menu, Playing, Win/Lose).
- Structured with classes (Ball, Paddle, Human/CpuPaddle) and method implementation to showcase encapsulation, inheritance, and polymorphism.
- C++ compiler ('clang++' or 'g++')
- Raylib (installed via Homebrew on macOS):
brew install raylib
git clone https://github.com/sanketsriv22/pong.git
cd pongIf using VSCode, just run build task (Cmd + Shift + B)
g++ -std=c++20 -I/opt/homebrew/Cellar/raylib/5.5/include \
-L/opt/homebrew/Cellar/raylib/5.5/lib \
-lraylib *.cpp -o Pong
./PongOr if you prefer cmake (I've added my CMakeList.txt)
brew install cmakeCreate a cmake build in the repo
cmake -S . -B buildCompile/Build (Cmd + Shift + B) And run
./build/pong- W (up), S (down) -> move player paddle
- Enter -> start game / restart after game over
- Esc -> quit
- Usage of 'Game' class to hold all environment object instances (merged 9/5)
- Two-player mode
- Sound effects
- Better AI for CPU paddle
- Different game modes/difficulties
- Customizable win conditions
- Create a Docker image for ease of use for testers!
