Emil SundmanSvenska

SDL-Spacegame

An early engine-independent C++ project exploring SDL2, manual game-loop programming, and ECS-based enemy representation.

Project context

SDL-Spacegame was an early C++ project from my Futuregames period where I worked directly with SDL2 instead of using a game engine. The project was used to explore a manual application/game loop, input, rendering, simple gameplay systems, and data-oriented design concepts.

The preserved implementation is a small Space-Invaders-like game with player movement, shooting, enemy waves, collision handling, and manual rendering through SDL.

What I implemented

I implemented the SDL setup and shutdown, the main application/game loop, keyboard input, player movement, shooting/projectile behaviour, enemy-wave spawning, rendering, enemy movement, and collision systems.

The code uses direct SDL event handling and an accelerated renderer. Enemy and projectile lifecycle is managed explicitly, and the loop includes manual frame-rate limiting using SDL performance counters and SDL_Delay.

ECS experiment

As part of the project, I experimented with moving enemy data and behaviour into an Entity Component System approach. The implementation includes entities, packed component arrays, signatures, systems, and coordinator/manager structures used for enemy movement and collision.

The ECS implementation was largely inspired by Austin Morlan’s public ECS article. I no longer know how much of the underlying ECS implementation was independently written versus adapted, so I do not present it as an original ECS architecture or as an ECS built from scratch.

Source

The historical implementation is available in the public GitHub repository.