A modern C++ implementation of the classic arcade game Space Invaders using SDL3 (Simple DirectMedia Layer).
- Classic Space Invaders gameplay with modern features
- Built with SDL3 for cross-platform compatibility
- Clean, modular C++23 code
- Optimised rendering and collision detection
- Support for keyboard controls
- Sound effects and optional font rendering with Sdl3_ttf
- C++23 compatible compiler
- CMake 3.20 or higher
- SDL3 library
- Sdl3_ttf library (optional, for enhanced text rendering)
git clone https://github.com/cschladetsch/CppSpaceInvaders.git
cd CppSpaceInvaders$ mkdir -p build && cd build && cmake .. && buildAfter building, the executable will be in the bin directory:
# From the build directory
./bin/CppSpaceInvaders- Left/Right Arrow Keys: Move the player ship
- Space: Shoot
- ESC: Pause/Exit game
CppSpaceInvaders/
assets/ # Game assets (sprites, sounds, fonts)
include/ # Header files
src/ # Source files
CMakeLists.txt # CMake build configuration
.gitignore # Git ignore file
Readme.md # This file
- Player: Controls the player ship at the bottom of the screen
- Enemy: Various alien invaders that move in formation
- Bullet: Projectiles fired by the player and enemies
- Barrier: Destructible shields that protect the player
- UFO: Special enemy that occasionally appears at the top of the screen
If SDL3 is not available in your package manager, you can build it from source:
git clone https://github.com/libsdl-org/SDL.git -b SDL3
cd SDL
mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --install .This project is licensed under the MIT License - see the LICENSE file for details.
- The original Space Invaders game was created by Tomohiro Nishikado
- SDL3 development team for their excellent multimedia library
