Galaxy Wars is an arcade-style shooting game developed using C++ with OpenGL and GLUT. Players control a futuristic ship, shoot bullets, and destroy incoming enemies — including special Trojan enemies that require multiple hits and offer bonus points.
- Player Control: Move left and right, shoot upward bullets.
- Enemy Types:
- 🔴 Normal Enemies: Red, die in one hit, +1 point.
- 🟣 Trojan Enemies: Purple, need 2 hits, blink on damage, +3 points.
- 💥 Explosions: Colorful visual effects on enemy destruction.
- 📊 Score Tracking: Real-time kill count display.
- 🗂️ In-game Legend: Shows controls and contributors.
| Key | Action |
|---|---|
| ⬅️ / ➡️ | Move Ship Left/Right |
SPACE |
Shoot Bullet |
ESC |
Exit Game |
- Geetansh Mohindru (102203718)
- Shrey Dhar Dubey (102383011)
- OpenGL (GLUT) based rendering
- Modular code structure with structs for Bullet, Enemy, and Explosion
- Real-time animation using
glutTimerFunc() - Collision detection between bullets and enemies
- Random enemy generation
- Trojan enemy logic: blinking and split-hit mechanism
To run this project using Visual Studio on Windows:
- Ensure your Visual Studio project is set to x86 (32-bit) configuration.
- Make sure OpenGL and GLUT (FreeGLUT) libraries are properly linked in:
- Project > Properties > Linker > Input > Additional Dependencies
- Include:
opengl32.lib,glu32.lib,freeglut.lib - Also, include the proper header/lib/dll paths in VC++ Directories.
- Try going to Build > Rebuild Solution to fix dependency issues.
- If you get errors related to the
#include <glut.h>line:- Replace it with:
#include <GL/glut.h>
- This depends on how GLUT/OpenGL is installed and set up on your system.
- Replace it with:
💡 This code assumes you are using the exact
.cppfile provided above (e.g.,finalCode.cpp).
