Experiments
Half-finished things, algorithm toys, and ideas I wanted to try. In progress works that aren't fully fledged out to be portfolio pieces.
A Godot based 2D puzzle platformer, within which, the gimmick requires you to beat each level by fullfilling conditionals that involve giving away your own directional inputs.
- Godot 4
- GDScript
- Python
- WebAssembly
Keyloss is a short puzzle platformer built in Godot. Each level is scattered with orange sacrifice blocks. Stand inside one and press its key, and that input is gone for the rest of the level. The goal flag stays locked until every sacrifice has been made, so the real puzzle is working out where and in what order to give your controls away.
Click the game to focus it. Arrow keys or A/D move, Space jumps, R restarts and Esc pauses.
The rules that make the puzzles
- The last press still counts. A jump block takes your jump, but the press that sacrifices it still jumps. Coyote time is the main source of these features.
- Directions carry you. Give up a direction while holding it and you keep sliding that way for a moment, which is often exactly what gets you onto the goal.
- You can sacrifice in mid-air. Passing through a block while airborne lets you give something up without using it.
- Some choices are free. The left/right block takes whichever direction you press first, even one you’ve already lost.
Everything else follows from those four rules. Later levels combine them with moving platforms, elevators and a slime.
Version 2
The first version was ten levels on a single screen with a plain grey menu made from scratch. Version 2 (with Ai assistance) turned it into a complete small game:
- A title screen with pixel-art key art and an animated keycap logo, where the “LOSS” keys occasionally fall off.
- A level select with unlock progression, best times and progress saved between visits.
- Five new levels in a new world, for 15 in total across three themed worlds: Meadow, Sunset and Dusk.
- A HUD that shows which keys you still have, with a key cracking when you give it up.
- Parallax hills, drifting clouds, particles, screen shake and iris transitions between scenes.
Under the hood
One block, many rules. The four sacrifice blocks started as four copy-pasted scripts. They now share a single base class, and each block type is a few lines that just lists which inputs it can take.
A bug that depended on your keyboard. After sacrificing a direction, the player kept sliding until the next input event arrived. In practice that was the operating system’s key-repeat delay, which varies from about a quarter of a second to a full second between machines, and simply moving the mouse ended the slide too. One level needed roughly half a second of slide, so whether it was winnable depended on the player’s keyboard settings. The slide is now a fixed 0.6 seconds, so every puzzle plays the same everywhere.
Generated art that matches the original. The new scenery and UI are produced by Python scripts that sample the colour palette of the game’s original tileset, so the parallax hills, keycap buttons and title art all look like part of the same pixel-art set. The new levels are written as ASCII maps and converted into ordinary Godot scene files, so they can still be edited in the Godot editor.
Built for the browser. The game uses Godot’s Compatibility renderer and a single-threaded web export, so it runs on GitHub Pages without any special server headers. Progress is saved in the browser.
What I learned
The best puzzles came from the smallest rules. “The last press still counts”, which was initially a bug, produced half the levels. I also learned the imprtance of user testing, because the slide bug was invisible until key-repeat timing was tested on a different system. Testing a puzzle game means testing all the features such as user interface, puzzle rules and the intuitiveness of the game systems.
Brickbreaker Remix
A feature-rich Brickbreaker Remix built in C++ and SFML, with a shop and economy system, randomized levels, per-brick-color bullet-hell behavior, and a phased boss fight.
- C++
- SFML
A brickbreaker clone built from scratch in C++ with SFML 3.x, grown iteratively into something with a lot more going on than bouncing a ball.
What it is
Classic brickbreaker at its core with a paddle, a ball, and bricks, but layered with systems that make each run feel different:
- Paddle = health bar. It physically shrinks when hit by bullets and grows back on a 5-hit streak. Less health means a smaller, faster-feeling target.
- Per-brick bullet types. Each color fires differently when the ball breaks it: red shoots a slow thick bullet, orange fires a 45° V-spread, green aims directly at your paddle, blue is fast, purple is baseline.
- Shop between stages. Clear the bricks, earn gold, pick from 3 random powerups. Gold idles between stages and earns interest (capped and expandable).
- Consumables. Press E to wipe every bullet on screen — you start with one charge and can buy more.
The boss fight
Stage 7 has a boss above the bricks with a moving indestructible shield. Three HP, ball returns to hand on each hit, white flash on contact.
- Phase 2 — random bricks gain a damage shield requiring an extra hit; a cyan pulse plays on each affected brick when the shields apply.
- Phase 3 — the top row of bricks merges into one full-width mega-brick (20 HP), with a horizontal grow-in animation as it forms.
The shield spawns in with a scale animation at each phase transition and moves a little slower than you’d like.
Why
Wanted a project where I could practice building interlocking game systems akin to a rogue lite. Systems such as an economy, progression, enemy behavior, all without a game engine in the way. SFML gives just enough (window, input, drawing) without making decisions for you.
Stack
- Language: C++17
- Graphics/input: SFML 3.1
- Build: Visual Studio 2022 on Windows