How we built Phase Lab, a browser game made with AI.
Phase Lab is a free wave puzzle game that runs in your browser: you add waves together until they match a target. We built it with AI in a single evening, by chatting with Claude and putting it live with Toupas after almost every change. This is how a one-line idea became a full-screen game, one round of feedback at a time, with a screenshot of each version.
- 01The idea
- 02First version
- 03Explaining it
- 04Make it a game
- 05All channels
- 06Too hard
- 07Two scopes
- 08Sliders & peek
The idea: a wave superposition game
The SHM Labs homepage had an empty second card that read “CH2 · No signal yet”. The site's name, its oscilloscope header and the formula x(t) = A sin(ωt + φ) all point to simple harmonic motion, so the first pitch was a game where you tune one wave until it matches a target.
Matching one wave is mostly fiddling with three knobs, though. The idea that stuck came next:
THE ASKMultiple input waves and one output wave. The superposition of the inputs should create the output.
That turned it into a real puzzle. You see a target shape, and you have to work out which waves add up to it.
Playable, but it looked like a form
The first build already had the full game in place: a scope showing the target, each channel's wave and their sum; plus/minus steppers for amplitude, frequency and phase; a match meter; moves and par; a “show what's missing” hint; 8 levels; and a daily signal generated from the date. It followed the site's light and dark themes, like the rest of SHM Labs.
A labelled screenshot beats a live preview
The playable preview was hard to read inside a chat window, so the next step was a set of annotated screenshots: what the grey band means, which line is the sum, where the knobs are, and how one round plays out from start to “locked”.
Two small but useful changes came out of that review. “CH1” became “Channel 1” everywhere. A question about why Channel 1 was fixed led to a clear rule: early levels fix one wave so you only have one thing to think about, and noise levels fix it because noise is something you can't control.
“It doesn't feel like a game”
This was the most important piece of feedback. The page was rebuilt from scratch as a game:
- A title screen with Play, Daily signal, Levels and How to play
- A dark, glowing scope that fills the screen, with a 20-light signal meter
- Synth-style knobs instead of form steppers
- Stars at stake in the header that dim as you use up moves
- A brief card before each level, sound effects, and a LOCKED stamp with sparks when you win
Mid-build came another request: keep the waves still while you solve. The first redesign drifted the waves across the scope, which made them harder to compare. Now they only start moving once the level is cleared, as a reward.
Stop hiding channels behind tabs
Version 2 showed one channel's knobs at a time behind tabs. The feedback was to show every channel as its own card and, on phones, to keep the signal panel pinned at the top while the cards scroll underneath. Fixed channels shrank to a compact read-only row, and knobs turned with a sideways drag so scrolling up and down still worked.
Fewer choices, one idea per level
Once it was live and played on a real phone, the verdict was that it looked good but was too hard. The fixes were all about making each choice clearer:
- Fewer positions: amplitude in quarters, phase in 45° steps (8 positions instead of 24), frequency up to 6f
- One new control per level: phase only, then amplitude only, then frequency only, before mixing them
- A smarter hint: green ticks on every control that's already right, plus the missing wave in pink
- Friendlier stars and a nudge toward the hint if you get stuck
Separate the inputs from the output
With every wave drawn on one scope, it was hard to tell your inputs apart from the result. The scope was split into two cards: an Output card with only the target and your sum, and an Inputs card with each channel's wave on its own. The finished wave also starts flowing across the scope when you clear a level.
Sliders you can read at a glance
Knobs look the part, but on a phone a slider is quicker to understand and easier to hit. Each channel now has three sliders with dots for every position and the value on the right.
The last request was about the win screen. Moving the result card to the bottom was the first plan, but a better idea won:
THE ASKInstead of moving the popup, ask if they want to see the inputs and signals. Maybe a long press.
So the result card stays in the middle, and pressing and holding it (or its eye button) fades it away to show both scopes with the finished wave. Let go and the result comes back.
Tips for building a game with AI
- Put it live early and play it on a real phone
- Short, honest feedback (“doesn't feel like a game”) is the most useful kind
- Screenshots explain a UI faster than a preview
- Teach one control per level before combining them
- Fewer, clearer choices make a puzzle feel fair
- Let players see cause and effect: inputs, then output
Try the result
8 levels, a new signal every day, and no sign-up.
Want to build something like this yourself? Read how to build a website with Claude or ChatGPT and make it live.