https://github.com/robertpaulp/tank-wars
OpenGL 2-Player Tank Wars 2D
https://github.com/robertpaulp/tank-wars
2d-game cpp opengl tank-game
Last synced: 3 months ago
JSON representation
OpenGL 2-Player Tank Wars 2D
- Host: GitHub
- URL: https://github.com/robertpaulp/tank-wars
- Owner: robertpaulp
- License: mit
- Created: 2025-02-13T16:12:43.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-14T17:39:14.000Z (8 months ago)
- Last Synced: 2025-02-21T20:18:52.460Z (8 months ago)
- Topics: 2d-game, cpp, opengl, tank-game
- Language: C++
- Homepage:
- Size: 36.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# **Tank Wars 2D - OpenGL Game**
## **Overview**
**Tank Wars** is a **2D tank battle game** built using **OpenGL and C++**. The game features real-time tank combat and collision detection. This project was developed as part of the **Computer Graphics Course (EGC)** at Politehnica University of Bucharest.
## **Features**
- **Player-controlled tanks** with movement and shooting mechanics.
- **Collision detection** between tanks, edge, and projectiles.
- **Basic physics simulation** for projectile motion and tank movement.
- **OpenGL rendering** for real-time graphics.
## **Game Mechanics**
### **Tank Movement**
- Tanks can move **forward, backward, and rotate** the barrel using keyboard controls.
### **Shooting System**
- Tanks can fire **projectiles** that follow a ballistic trajectory.
- Projectiles **collide with tanks**, dealing damage or being destroyed.## **Installation & Running**
### **Build & Run**
1. **Clone the repository:**
```sh
git clone https://github.com/robertpaulp/Tank-Wars.git cd Tank-Wars
```
2. **Build and Run on Windows:**
- Install Visual Studio (with "Desktop development with C++" module)
- Install CMake
- Open CMake GUI:
- Set source code path to project root
- Set build path to `build` directory
- Click Configure and Generate
- Click "Open Project" to launch Visual Studio
- In Visual Studio:
- Build and Run the solutionNote: Source code for the Tank Wars game is located in `src/lab_m1/Tank_Wars/`
## **Controls**
- **Player 1**
| Action | Key |
| ------------------- | ----- |
| Move Forward | W |
| Move Backward | S |
| Rotate Barrel Left | A |
| Rotate Barrel Right | D |
| Fire Projectile | Space |- **Player 2**
| Action | Key |
| ------------------- | ----------- |
| Move Forward | Up Arrow |
| Move Backward | Down Arrow |
| Rotate Barrel Left | Left Arrow |
| Rotate Barrel Right | Right Arrow |
| Fire Projectile | Enter |## **Game Screenshots**
![]()