NOTE: SimpleEngine2D is still in active development. Expect rough edges, unfinished features, and bugs. Contributions are welcome.
SimpleEngine2D is a lightweight C++ 2D game engine with an integrated editor. It provides a simple ECS-style architecture, core engine systems, and a sample game to build from. It is not meant to replace modern 2D game engines, but meant to show what I can do and also potentially make 2D game development more interesting and a little easier for some :)
Create a game scaffold --> implement your scenes/systems --> run it with the engine!
- Provides core 2D engine systems (rendering, input, physics, collision, audio)
- Uses component-based entities for flexible game object composition
- Includes an in-repo editor for scene/entity inspection and editing
Language
- C++17
Core libraries
- SDL2
- SDL2_image
- SDL2_ttf
- SDL2_mixer
- GLM
- nlohmann/json
- ImGui (editor UI)
Build tools
- CMake
- Make (helper commands)
Install dependencies:
Automation currently supports Fedora. Support for more operating systems is coming soon (you can contribute it if you want!). If you are on another OS, check deps.txt and install the listed packages manually for your distro/package manager.
make depsBuild everything:
make buildRun a game:
make run NAME=test-gameCreate a new game scaffold:
make game NAME=my-gameBuild the editor:
make editor-buildRun the editor:
make editor-runIf you want a concrete reference, use games/test-game as a template for scene structure, components, and systems.
- Create a game scaffold:
make game NAME=my-game-
Replace
games/my-game/src/main.cppwith engine startup code:- Create one or more scene classes that inherit
simpleengine2d::core::Scene - Register scenes with
simpleengine2d::core::SceneManager - Start the engine with
engine.init(sceneIndex); engine.run();
- Create one or more scene classes that inherit
-
In your scene
setup():- Create entities with
EntityManager - Add components like
TransformComponent,MeshComponent,ColliderComponent,TextGuiComponent - Add your custom systems through
Engine::getInstance().addSystem(...)
- Create entities with
-
Build and run:
make run NAME=my-gameContributions are welcome. Bug fixes, new systems/components, editor improvements, and sample content are all helpful.
IMPORTANT: If you open a PR, keep changes focused and include a short description of what you added/changed and your approach. If possible, also add images of what you changed.
If you want a place to start, here are good first ideas:
- Add support for other image formats (engine currently only supports .bmp)
