A client-server online Pong game built using a small custom framework that wraps Asio for networking, and OpenGL for real-time rendering.
Pong.Net.mp4
- Online multiplayer Pong: Two players connect as clients to a dedicated server that hosts the game session.
- Client-server architecture: The server is responsible for most game logic and state updates.
- Automatic match reset: The game resets when both players disconnect.
- Language: C++
- Standard: C++20
- Dependencies:
- Asio (standalone)
- ImGui (with FreeType font rendering)
- OpenGL
- GLFW for input and windowing
- GLM (OpenGL Mathematics)
- miniaudio
- Build System: CMake
- Compilers: Clang 14+, GCC 11+, MSVC 17.1+
- Platforms: Windows & Linux
- Architecture: Client-Server over TCP
Clone this repository
git clone https://github.com/LT2H/PongNet.git
If you're on Linux, install the following system packages before building.
These are required by GLFW:
sudo apt install libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libxcursor-dev libxinerama-dev
Build Server and Client
cd PongNet
cmake -S . -B build
cmake --build build
Optional: If you use Ninja
cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DCMAKE_CXX_COMPILER=clang++ -S . -B build
cmake --build build
How to play
-
Start the server: Launch the server binary and choose a port.
-
Start the clients: Run two client binaries on different machines or instances.
-
Connect: Each client enters the server’s IP and port.
-
Play: The game begins automatically when both players are ready.
Controls
-
A / D – Move left / right
-
SPACEBAR – Launch the ball
-
ESC – Open the quit menu
- This repository is licensed under Apache 2.0 (see included LICENSE.txt file for more details)