Case study
One More Turn
A turn-based pixel dungeon you play in the browser. Enemies show their next step, so every room is a short tactical puzzle.
More detail
The problem
Most roguelikes are about reflexes. I wanted one that is about reading the board.
You get a 9×9 room, a limited energy budget, and enemies that show exactly where they will step next. Nothing moves until you do. Each room is a short tactical puzzle, and the pull is to try just one more.
One More Turn is that game. It runs in the browser on desktop and mobile, with keyboard, swipe or on-screen controls. There is no install, and progress is saved on your device.
Who it's for
People who like turn-based puzzles and roguelikes, and anyone who wants a short dungeon they can open in a tab and come back to later.
What I built
- Read the room. Enemy intents are drawn on the board as red markers, so every threat is visible before you commit.
- Spend energy. Each step costs one energy. Orbs refill it, gems pay coins, potions heal.
- Reach the stairs. Optional missions (take no damage, finish quickly, collect every orb, or get a kill) pay bonus score.
- Choose a boon. Every two rooms you pick one of three upgrades: an extra heart, more energy, trap resistance or Quick Step.
- Beat the boss. Every fifth room is a boss fight. The Warden, Brood Queen, Bone Lich and Storm Golem each telegraph their attacks across the board, and you hit them by stepping on glowing runes.
- Spend coins and come back. Coins buy permanent upgrades in the shop, and achievements unlock new hero looks and colours.
Stack
TanStack Start, React 19 and TypeScript, Tailwind CSS 4, a Canvas 2D renderer, Web Audio and Vitest. Deployed to Vercel.
Key decisions and why
Telegraphs instead of reflexes. Enemies reserve their next tile and lock that intent for the turn, so a dodge you can see is a dodge that works. Deaths should feel earned, not random.
Forgiveness that keeps a run going. You get one undo per room, three attempts per room with checkpoint retries, and coins can buy one more attempt. The idea is to learn the room instead of restarting the whole run.
Variety from a few rules. Eight monster types (chaser, patrol, guard, ghost, bat, archer, slime, mimic), plus ice, teleport, crumbling and one-way floors, spikes and bombs. Each one adds a single readable rule. Together they change how a room plays.
Rooms are always solvable. The generator checks a guaranteed route with BFS (through the switch, when there is one), and special floors never sit on that route.
Modes for coming back. Daily Dungeon gives everyone the same seed and turns off shop upgrades. Hard mode starts you with less energy and scores 1.5×. Bosses get enraged after room 20.
The system
The game rules live in a plain TypeScript engine that does not import React, covering turns, the room generator, the canvas renderer and the sound. The interface subscribes through useSyncExternalStore, so it only updates when the engine version changes.
A run is stored as its seed plus a compact action log. "Watch Best Run" feeds those actions into a fresh engine, which only works because every bit of randomness is derived from the seed. The same property makes Daily Dungeon fair for everyone.
Pixel sprites are drawn from string maps. Movement is interpolated with hop animations, and there are particle bursts, floating score text and screen shake. Sound effects and music are synthesised live with the Web Audio API, so the game ships no audio files.
Every coin reward has a stable ID (room plus tile, or achievement plus index), so retries, undo and checkpoint restores can never pay out twice.
Progress, coins, upgrades, achievements and the best-run replay are saved on the device. The game makes no backend calls to run, and it needs no environment variables to deploy.
48 Vitest tests cover energy, health, orbs, room solvability, enemy trapping, the shop and the newer mechanics.
The layout is one centred, board-width column, with controls below it in portrait and beside it in landscape. Pointer capture keeps swipes reliable on phones.
Where it is now
One More Turn is live at onemoreturn.vercel.app. You can play from the first visit, and progress is saved on the device. Source is available on request.
What I'd do next
- More bosses and floor types for deeper runs.
- A shareable daily result card.
01 / Results
- Live at onemoreturn.vercel.app.
- Playable from the first visit, with progress saved on the device.
- Source is available on request.
Next project
Ownbook