Skip to content

A simple Space Shooter game coded and designed in C++ language in OpenGL.

License

Notifications You must be signed in to change notification settings

Zer0-Bug/ArcadeSpaceShooter_OpenGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Shooter: OpenGL Arcade Experience

C++ OpenGL GLUT Visual Studio License

A high-adrenaline 2D Space Shooter game built using C++ and OpenGL/GLUT. Experience classic arcade mechanics featuring procedurally generated starfields, dynamic collision detection, and a reactive UI system, all rendered using hardware-accelerated graphics.

° ° ° °



Technical Architecture

The game engine is designed around the GLUT Event Loop, managing real-time rendering and state transitions via a callback-based architecture:

  1. Rendering Engine: Utilizes GLUT_DOUBLE buffering to eliminate flickering. The coordinate system is mapped using glOrtho to provide a consistent 800x600 resolution.
  2. State Management: Controls transitions between WelcomeScreen, Gameplay, and GameOver states using boolean flags and reactive timers (glutTimerFunc).
  3. Collision Logic: Implements an AABB (Axis-Aligned Bounding Box) collision detection algorithm to manage Bullet-Enemy and Enemy-Player interactions.
  4. Procedural Background: Features a dynamic starfield system where 100+ stars are generated with randomized velocities to create a parallax-like depth effect.


Project Structure

ArcadeSpaceShooter_OpenGL/
├── LICENSE                                   # MIT License
├── README.md                                 # Project documentation
├── .gitattributes                            # Git configuration
│
├── OpenGL/                                   # Source and Visual Studio Solution
│   ├── SpaceShooter/
│   │   ├── SpaceShooter.cpp                  # Main Game Logic & Rendering
│   │   └── SpaceShooter.vcxproj              # VS Project Configuration
│   ├── packages/                             # NuGet dependencies (FreeGLUT)
│   └── SpaceShooter.sln                      # Visual Studio Solution File
│
└── Screenshots/                              # Visual Gameplay Previews
    ├── OpenGL_v1.png
    ├── OpenGL_v2.png
    └── ...


Gameplay Mechanics

  • Spacecraft Navigation: Responsive vertical movement across the screen.
  • Tactical Combat: Fire high-speed projectiles to eliminate infinite enemy waves.
  • Dynamic Enemies: Enemies spawn at randomized Y-coordinates with increasing speed.
  • Score Tracking: Real-time HUD displaying the current session score.
  • Atmospheric Depth: A live-rendered starfield provides an immersive cosmic backdrop.

Controls Table

Action Input Key
Move Up W
Move Down S
Fire Bullet Space
Start / Restart Space / Y


Technical Specifications

Component Specification
Language C++ 17
Graphics API OpenGL 2.1+ / GLUT
Resolution 800 x 600 (Fixed Orthographic)
Performance Target 60 FPS (16ms Refresh Rate)
Dependency Manager NuGet Package Manager


Deployment & Installation

1. Repository Acquisition

Clone the project to your local workstation:

git clone https://github.com/Zer0-Bug/ArcadeSpaceShooter_OpenGL.git
cd ArcadeSpaceShooter_OpenGL

2. Launching in Visual Studio

  1. Navigate to the OpenGL/ directory.
  2. Open SpaceShooter.sln using Visual Studio 2019/2022.
  3. Under Tools > NuGet Package Manager, select Restore NuGet Packages to install freeglut.

3. Build & Run

  1. Set the solution configuration to Debug and the platform to x64.
  2. Press F5 to compile the source code and launch the space shooter environment.


Contribution

Contributions are always appreciated. Open-source projects grow through collaboration, and any improvement—whether a bug fix, new feature, documentation update, or suggestion—is valuable.

To contribute, please follow the steps below:

  1. Fork the repository.
  2. Create a new branch for your change:
    git checkout -b feature/your-feature-name
  3. Commit your changes with a clear and descriptive message:
    git commit -m "Add: brief description of the change"
  4. Push your branch to your fork:
    git push origin feature/your-feature-name
  5. Open a Pull Request describing the changes made.

All contributions are reviewed before being merged. Please ensure that your changes follow the existing code style and include relevant documentation or tests where applicable.

Email × LinkedIn


Releases

No releases published

Packages

No packages published

Languages