A C++ 2D game engine (SFML + Box2D) with a platformer demo.
This project is a custom 2D engine built in C++ using SFML for rendering/input and Box2D for physics. A platformer demo validates the engine systems through a concrete gameplay scenario (movement, collisions, enemies, levels, UI).
The engine's original platformer demo is still included too, kept as a bonus: the concrete scenario (movement, collisions, enemies, levels, UI) the core systems were first built and tested against.
Systems are layered: a fixed-timestep game loop drives scene updates; each scene owns entity lists and delegates rendering, physics, and gameplay in a strict order.
SFML handles windowing, input polling, and draw calls. The render pass runs after simulation so visuals always reflect the latest physics state.
Box2D bodies are owned by gameplay entities. Collisions trigger gameplay events (damage, pickups) without tight coupling to the physics library internals.
// Fixed update order (simplified)
while (accumulator >= FIXED_DT) {
scene->processInput();
scene->updatePhysics(FIXED_DT);
scene->updateGameplay(FIXED_DT);
accumulator -= FIXED_DT;
}
scene->render();
Rendering and simulation are isolated behind scene interfaces so future 3D backends could replace SFML draw paths without rewriting gameplay rules.
Iteration cycle: implement engine feature → validate in platformer demo → refactor boundaries → document update order. Git branches per system (physics, UI, levels).
Building a modular engine means defining clear system boundaries while keeping the demo game fun and stable.