Engineering

Side project · Prototype · 2026

Kororo

A browser-based 3D puzzle game where players push and pull blocks to create a path through each level.

playable preview on itch.io, in the browser
0.4.5
Source: playable preview on itch.io, in the browser
story walls across four worlds, plus a level editor
13
test files: 226 for the app, 38 for the level tools, 19 for the rules, 7 for the playtest tools
290
Kororo gameplay: the player pulls a block from a wall, climbs it and returns the light to the lighthouse
Pull a block, climb it, return the light · gameplay from the preview

TypeScript · React · Next.js · Three.js · React Three Fiber · Web Workers · Vitest

Problem

I wanted to bring back a push-and-pull puzzle mechanic I loved, and see how far it goes as a browser game built alone.

I built the game simulation, the 3D interface, undo and replay, and the level solver.

Critical point 1 of 3

The rules are one pure function.

A wall is written as text, one drawing per depth layer. Every move goes through one function that takes the level, the state and an action, and returns a new state. The 3D scene, the animation and the dialogue only show that state.

Kororo, the wall named Doorway: a stone arch on a small island, a glowing exit inside it, a pink block at its foot and Pon, the green character, in front
“Doorway”, the first wall, in the game. Par 4, top right.

Its level file

.###..#.#..#X#..###..#A#.

As the rules see it

# stone · A the pink block you pull · X the exit, the light. Back layer of three.

applyAction(level, state, action) → state
  • Integers only, no floats
  • No clock, no random numbers, no DOM
  • Returns a new state, never changes the old one
  • The rules package has no runtime dependency
From packages/sim/src/types.ts, actions.ts and packages/levels/src/ascii.ts.

Critical point 2 of 3

Undo is a list of states. A replay is a list of actions.

A state is plain data, so the game keeps every earlier one in an array. The rules always give the same answer, so a list of actions is enough to play a whole run again, on another machine too.

Kororo, a wall on the ice: pink, orange and yellow blocks on a floe under falling snow, Pon standing beside them
The ice. A step slides until something stops it: same function, one more rule.
  1. state0
  2. walk
  3. state1
  4. grab
  5. state2
  6. shove
  7. state3
  8. release
  9. state4

UndoStep back to the state before. Redo keeps up to 512 undone moves.

ReplayKeep the actions. Run them again from state 0 and you get the same states.

Publish checkverify(level, actions) runs the same rules on a submitted solution. It refuses anything over 20,000 actions.

The action names are the game’s real verbs. This sequence of four is illustrative. From apps/web/src/game/store.ts and packages/sim/src/verify.ts.

Critical point 3 of 3

The solver runs in a Web Worker and returns the shortest route.

The page posts a level to the worker and keeps animating. The answer is the shortest route, and it sets the par on screen. The first wall’s par is 4, computed this way. A search may visit up to 6 million states, and the dearest shipped wall uses 73% of that.

Kororo, a wall in the cave: yellow lantern blocks stacked on a rock, purple crystals and a rope bridge in the dark around them
The cave. Lantern blocks carry the light, and you can only step where it reaches.
  1. Page, main thread{ id, level, options }Keeps drawing. To cancel, it terminates the worker.
  2. post
  3. Web Workersolve(level, { maxNodes: 6_000_000 })A bucket-queue search that counts moves the way the player’s counter does.
  4. reply
  5. Page, main thread{ id, result, ms }The shortest route, as actions a player can press, and the time it took.
From apps/web/src/game/solve.worker.ts, useSolver.ts and packages/sim/src/solver.ts. The editor’s checker runs in a second worker, judge.worker.ts. No solving time is published yet.

Result

Preview 0.4.5 is playable on itch.io.

13 story walls across four worlds, plus a level editor. Still in development.