SHM Labs/Writing/Building Phase Lab
BUILD LOG · PHASE LAB

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.

ONE EVENING~3 hours
MAJOR VERSIONS7
LEVELS8 + daily
FILES1 HTML page
01 · THE IDEA

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.

02 · FIRST VERSION

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.

First version: a light page with a scope, a match bar and rows of plus and minus buttons for CH1 and CH2
Version 1, level 2. Everything worked, but it read like a settings page.
03 · EXPLAINING IT

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.

Three frames: the two inputs cancel to a flat line, turning the phase grows the output, the output locks onto the target
The mockup used to explain a round: start, turning the phase, locked.
04 · MAKE IT A GAME

“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.

Three phone screens: the dark Phase Lab title screen, a level with knobs, and the green LOCKED celebration
Version 2: title screen, playing with knobs, and the win moment.
05 · ALL CHANNELS AT ONCE

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.

Two phone screens: channel cards listed below the scope, and the same screen scrolled with the scope still pinned at the top
Every channel in the list, and the signal panel staying put while you scroll.
06 · TOO HARD TO PLAY

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
Phone screen of the Silence level with the hint on: a pink dotted missing wave and a green tick on the correct amplitude knob
The hint: the pink line is what's missing, the tick shows AMP is already right.
07 · TWO SCOPES

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.

Desktop layout: an output scope with the target and the sum, an inputs scope below it, and channel cards on the right
Output on top, inputs below, channels on the right.
08 · SLIDERS AND PEEK

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.

Three phone screens: channel cards with sliders, the level-cleared card, and the same screen while holding to peek at both scopes
Sliders, the result card, and holding to peek at the waves.
Desktop layout of the final version with sliders in the channel cards
The current version on desktop.
WHAT WE LEARNED

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.

Play Phase Lab

Want to build something like this yourself? Read how to build a website with Claude or ChatGPT and make it live.