A lightweight, modern game development framework built with C++23 and SDL3,
designed around the ECS(Entity Component System) architecture. This repository includes two parts:
- Core Framework (core): Provides
ECSandSDL3utilities for game development. - Survivor (survivor): A top-down survivor-style game built on the
coreframework.
Survivor demo preview:
survivor-0.1.2.mp4
project structure:
game/
├── core/ # Core ECS Framework
│ ├── include/core/ # Public headers (ECS, AssetManager, RenderManager)
│ ├── src/ # Framework implementation
│ ├── assets/ # Framework assets (fonts, animation finite state machine)
│ └── third_party/ # Dependencies
│ ├── ecs/ # My simple ECS framework
│ ├── wheel/ # My utility library (Log, Timer, QuadTree, etc.)
│ ├── sdl/ # My OO wrapper for SDL3, SDL3_image, SDL3_mixer, SDL3_ttf
│ └── reflect-cpp/ # C++20 reflection library
├── games/ # Game Projects
│ └── survivor/ # Demo: 2D Top-down survivor game
│ ├── src/ # Game logic (player, enemies, level design)
│ └── assets/ # Game assets (configs, sprites, animations, sounds, music)
├── editor/ # Game Editor (TODO)
└── LICENSE # MIT License- Modern C++23: Leverages latest standards for clean, efficient code.
- SDL3 Integration: Hardware-accelerated rendering, audio, input handling, and window management.
- ECS Architecture: Decoupled entity-component logic for scalable, maintainable game code
- C++ compiler: need C++23 support. (e.g.,
g++orclang++) - cmake: ninja is recommended for faster builds.
- git: for cloning the repository and submodules.
Note: This project has been tested on Arch Linux. For Windows/macOS, minor modifications to CMakeLists.txt may be required.
- clone the repository
git clone --depth=1 https://github.com/m1dsolo/game.git
cd game
git submodule update --init --depth=1
cd core/third_party/sdl/third_party
git submodule update --init --depth=1
cd -- build the project
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build -j8- launch the
Survivorgame
cd build/games/survivor
./survivorGame Controls:
| Action | Keyboard | Gampad |
|---|---|---|
| Menu Navigation | W/S | D-Pad Up/Down |
| Character Movement | WASD | Left Stick |
| Open Pause Menu | ECS | Start Button |
To build your own game with the core framework:
Create a new game directory under ./games (e.g., ./games/your_game).
Add a CMakeLists.txt to your game folder, linking against the core framework:
add_executable(your_game src/main.cpp src/Player.cpp src/Enemy.cpp)
target_link_libraries(your_game PRIVATE core)Re-run the build commands (Step 2 above) to compile your game.
Refer to Survivor's CMakeLists.txt for a complete example.
Sprites:
Sounds:
Repositories:
MIT © m1dsolo