An OpenGL-powered C++ remake of the 1978 arcade classic Space Invaders.
This repository contains a desktop game built with:
- C++20
- OpenGL for rendering
- GLFW + GLAD for windowing/context/input
- GLM for math
- stb_image and spdlog as supporting libraries
- A custom lightweight game/audio architecture in
Space_Invaders/src
The project is currently configured for Windows + Visual Studio 2022 via Premake and ships with Visual Studio solution/project files already generated.
- Classic Space Invaders gameplay loop (waves, score, lives, shields, game over/reset)
- Player movement and shooting with cooldown
- Alien swarm movement, projectiles, and collision handling
- Bonus alien ship events
- Procedural retro-style synthesized audio for gameplay effects and background notes
- On-screen HUD text (score, high-score, lives, credits)
.
├── premake5.lua # Build configuration (workspace/projects/configs)
├── Space_Invaders.sln # Visual Studio solution (generated)
├── scripts/
│ └── GenerateProjects.bat # Regenerate VS project files with Premake
└── Space_Invaders/
├── src/
│ ├── Engine/ # Rendering, shaders, buffers, sprite systems, timing
│ ├── Game/ # Game objects, state management, logic, audio handler
│ ├── Application.* # App lifecycle + main entry point
│ └── Log.* / pch.*
├── res/
│ └── shaders/Basic.shader
└── vendor/
├── GLFW/
├── glad/
├── glm/
├── spdlog/
└── stb_image/
To build from source on Windows:
- Visual Studio 2022 with C++ desktop workload
- Windows 10/11 SDK
- (If regenerating projects) bundled Premake binary at:
vendor/bin/premake/premake5.exe
The project uses
PlatformToolset v143,x64, and OpenGL viaopengl32.lib.
- Open
Space_Invaders.slnin Visual Studio 2022. - Select configuration:
Debug | x64Release | x64Dist | x64
- Build the solution.
- Run
Space_Invadersas startup project.
From repository root:
cd scripts
GenerateProjects.batThen open the regenerated Space_Invaders.sln and build as above.
Executables are emitted to:
bin/<Configuration>-windows-x86_64/Space_Invaders/Space_Invaders.exe
Examples:
bin/Debug-windows-x86_64/Space_Invaders/Space_Invaders.exebin/Release-windows-x86_64/Space_Invaders/Space_Invaders.exe
| Action | Keys |
|---|---|
| Move left | A or Left Arrow |
| Move right | D or Right Arrow |
| Shoot | Space or Up Arrow |
| Decrease volume | - |
| Increase volume | = |
| Quit | Esc |
- You start with multiple lives and defensive shields.
- Destroying aliens increases score.
- High score is tracked during runtime.
- The game ends if aliens reach the ground or the player loses all lives.
- After game over, a new round is automatically initialized.
If you only want to play:
- Download the latest release from the Releases page.
- Extract the archive.
- Run
Space_Invaders.exe.
- Window/input loop is driven by GLFW in
Application. - Projection uses a fixed 2D orthographic game space.
- Game logic is coordinated by
GameandGameStateManager. - Audio clips are synthesized procedurally in
AudioHandler(no external sound assets required).
- Project won’t open/build: verify Visual Studio 2022 C++ toolchain + Windows SDK are installed.
- Project files out of sync: rerun
scripts/GenerateProjects.bat. - Black screen or GL init issues: ensure your graphics driver supports OpenGL and that required DLLs from build output are present.
- No audio output: confirm a valid output audio device is available/enabled on the system.
This project is licensed under the terms of the GNU GPLv3 license.
