A 2D physics-based arena game built from scratch in C++ using SDL2, featuring dynamic gravity switching and recoil-based movement.
Players fight inside a bounded arena with platforms while the game randomly switches between normal gravity and zero gravity modes.
-
Dynamic Gravity System
- Normal Gravity → Players fall and move normally
- Zero Gravity → No direct movement, players must use recoil to move
- Random switching creates unpredictable gameplay
-
Recoil-Based Movement
- Shooting applies force in the opposite direction
- Used as the primary movement mechanic in zero gravity
-
Combat System
- Infinite bullets with fire rate limit
- Bullet collision and damage system
- Health-based elimination
-
Platform Arena
- Static platforms for positioning
- Boundary constraints to keep players inside arena
- C++
- SDL2
- SDL2_image
- Custom game loop and physics (no external engine)
- ✅ Delta-time based movement
- ✅ Custom physics system (velocity, gravity, air drag)
- ✅ Axis-separated collision detection (AABB)
- ✅ Gravity + Zero Gravity modes
- ✅ Recoil-based movement system
- ✅ Shooting system with rate limiting
- ✅ Two-player local multiplayer
- ✅ Health system
- ✅ Texture rendering
- Move:
W A S D - Shoot:
Space
- Move:
Arrow Keys - Shoot:
r
- SDL2
- SDL2_image
- g++
Install SDL2 and SDL2_image using MSYS2 packages.
g++ src/main.cpp -lSDL2 -lSDL2_image -o build/game.exe./build/game.exemultiplayer-arena/
├── src/
├── include/
├── assets/
│ └── images/
├── build/
├── README.md
├── Makefile
└── .gitignore
Gravity mode
Zero Gravity mode
- Online multiplayer (networking)
- 360° aiming system
- Moving platforms
- Sound effects
- Score system and match timer
- Improved animations
- Game loop design
- Physics simulation (gravity, velocity, damping)
- Collision detection & resolution
- Real-time input handling
- Rendering using SDL2
- Structuring C++ projects
P Sai Maneesh
This project was built to strengthen C++ system-level and game development skills without using heavy game engines.

