Skip to content
CppCooperProgramming Portfolio
Selected projectProject year 2026

Space Invaders: Cheryl Engine 4 Port

Space Invaders rebuilt around Cheryl Engine 4’s runtime, with coordinated waves, player state, menus, adaptive audio, and a persistent top-ten table.

Version
Cheryl Engine 4 port
Status
Completed
Built with
C++, Cheryl Engine 4, TGUI, RmlUi
My work
Runtime, gameplay, UI and audio integration
The case study

Project overview

This version brings Space Invaders to Cheryl Engine 4. It keeps the advancing formation and randomized enemy volleys, while rebuilding the connection between the game and its runtime. Combat, player death, new runs, menus, audio, and persistent scores now have to agree about which state the game is in.

Space Invaders: update flow
The port applies a new-run request at an update boundary. Gameplay events coordinate the world, score, interface, and audio.

Giving the runtime clear ownership

Application startup creates the engine context and runs a game object. Platform setup loads assets and attaches input; simulation setup creates the actors and registers their event listeners. Rendering receives a prepared frame containing the world draws and interface passes. The game no longer needs to organize its own draw/update handshake.

That separation matters when a run ends or restarts. A New Game menu action sets a request rather than immediately replacing actors. The reset happens at an update boundary, after the input batch and previous collision iteration have finished using the old objects. It then clears bullets, resets score and lives, rebuilds the formation, and restarts the music.

One difficulty value, several effects

The invasion has ten columns and seven rows. At an edge it reverses direction, descends, and increases a shared game-speed value. That value affects movement, the player’s firing interval, enemy animation, score, and color. Bullet speed and music playback use capped scaling, so their response does not keep increasing at the same rate as the formation.

Only the frontmost surviving invader in each column is eligible to shoot. Removing one changes the next volley’s possible shooters. Clearing the formation starts another wave after its explosion effects finish. A separate UFO chooses horizontal targets and returns after being destroyed.

A run begins with three lives. Losing one clears the bullets and holds the invasion during the death sequence. The player then respawns, or the run ends when no lives remain. The formation reaching the player’s height is another game-over condition. These transitions share events with the interface and audio instead of each system inventing its own end-of-run rule.

Keeping menus and sound in step

TGUI draws the score and life icons. An RmlUi menu handles pause, resume, a new game, the top-ten table, and name entry. Score entry takes keyboard focus while the world is paused. The score loader also accepts the older single-number file, preserving that value when moving to the named table.

Enemy volley sounds are assembled into audio samples with 22-millisecond spacing. Using one prepared clip per volley makes that spacing independent of frame updates. Music playback follows the game-speed value, and pausing suspends the music and stops active effects. Music from Minifantasy Forgotten Plains and effects from Helton Yan’s Pixel Combat are separate asset contributions.

Playing the current version

Move with A/D, Left/Right, or a gamepad’s left stick. Hold Space or a gamepad fire control to shoot; Escape or Start opens the menu. Asset and high-score paths can be supplied on the command line.

The port is complete, with gameplay, interface, audio and persistent scores integrated into Cheryl Engine 4.

By Joshua Cooper Published Updated

Keep exploring

More projects

View the portfolio