How we built Floor Nine
How we built Floor Nine
A CognitoRiverDelta builder project by Don Wood. In The Night Shift, the panel's robots race on Floor Nine at night. This is the simple, open version that lives on our Academy page: anyone can play it, read it, and change it. In the show, the panel found this little page and built a far bigger secret version of their own. Yours can grow too.
Iteration 1: a playable floor in one session
The dated pairs
| When | What |
|---|---|
| 2026-10-09, afternoon | Idea. Don Wood: turn the Floor Nine world from The Night Shift, episode 1, into a small web game a teenager can play on a phone or a laptop. It needs program cards, conveyors, gears, pushers, crushers, wall lasers, pits, repair pads, four flags in order, and robots that only ever reboot. Don asked for obstacles that look good, because the ones in his earlier board-game attempt looked plain. |
| 2026-10-09, 16:56 | Code started. The AI coding partner had read the episode, Don's earlier robot-racing game and Orbit Lab first. |
| 2026-10-09, 17:02 | Working page (v1). Six full computer-played races finished in 7 to 14 rounds each, with no errors in the browser console. The page also fit a 375-pixel phone screen with no sideways scrolling. |
| not yet | Live on the Academy page, after a private preview and our safety checks. |
Time, measured: from code start (16:56) to the working page (17:02). The time from Don's request to going live will be added here when it goes live.
The goal
One sentence: let a young builder play a robot race in one minute, then open one file and change the floor.
Who it serves: young builders, aged 13 and up, and anyone curious about how a game's rules become code. How we'll know it works: a race finishes in about 10 rounds, it plays on a phone, and a young tester can add one new board element after reading the code for 15 minutes.
The steps we took
- Read first. We read the episode (the world, the rules and the hazard sounds), Don's earlier game (a hex board, a game server, several views and a lot of board elements), and Orbit Lab (one page, one script, one stylesheet).
- Square tiles, not hexes. Conveyors, walls and lasers line up naturally on squares, and four directions are easier to read in code than six. Floor Nine is a 12 by 12 grid in the episode, so squares fit the story too.
- A map you can read. The board is 12 lines of two-letter codes at the top of the script (
>fis a fast belt heading east,PPis a pit). Walls, pushers and lasers are short lists of "tile plus side". - One set of rules, two speeds. A round is a generator, a function that pauses at every beat. The page waits between beats so you can watch. The AI runs the same function without waiting to try a few hundred card orders and keep the best one. No rule is written twice.
- Board elements as a list. After each register the floor acts in order: fast belts, all belts, pushers, gears, crushers, lasers, then flags and crates. Each one is a small entry in
PHASES. - Option chips as a list. Mirror Shield, Ghost Step and Overclock are three short entries in
CHIPS. - Make the hazards look good. Chevrons move along the belts (fast belts move faster), gears turn, pusher plates slide out on their registers, crusher plates hover and then slam down with a small screen shake, lasers glow and flicker with light pulses riding along them, pits get darker the deeper they go, and two orange hazard beacons sweep the floor. It's all plain Canvas drawing, with no 3D library and no image files.
- Sounds made in code. Every cue (the belt rumble, the pusher hiss, the crusher slam, the laser whine, the flag chime, the power-down chime) is a tone or a burst of filtered noise. Nothing is downloaded.
- Test like a player, then like a machine. We played rounds by hand, and then a script played six whole races and checked after every round that no robot was off the board, no two robots shared a tile, and every locked register matched the damage.
- Fix what we found. Each robot's flag line (what it says when it reaches a flag) used the same name as the flag counter, so the log printed a number instead of the line. One legend swatch shared a style name with the option-chip buttons, so it broke onto its own line. Both are fixed.
Who decided what
The builder (Don Wood) decided: the game itself and its world (Floor Nine, four flags, THE NEXT ITERATION, robots that reboot and are never hurt), the robot names from the show, the list of board elements and option chips, that obstacles must look good, that it runs free in a browser with no server, the audience (a teenager on a phone), the size budget, and when it's good enough to ship.
The AI coding partner decided (Don can overrule any of these): square tiles instead of hexes; 2D Canvas instead of a 3D library, so you can open the page by double-clicking it, because a browser won't load 3D library modules from a plain file; the board layout; the damage numbers (5 locks a register, 8 reboots); robots bumping a whole line of robots along; the AI's "try a few hundred plans" method and each robot's personality as a number; and the robots' lines in the floor log. It also wrote the code, ran the tests in a browser and proposed the fixes.
What we simplified from Don's earlier game
Don's earlier game is a hex board run by a game server, with several views (a top-down map and a 3D room), a store, a command bus and many board elements (towers, mines, drones, blimps and tanks), plus health, charge and score. For a first builder project we kept the heart of it and dropped the rest:
- No server. Everything runs in one browser page, so it's free, and it's private because nothing is sent anywhere.
- One view, not several. One canvas. A second view is a great iteration 2 project.
- Programmed cards instead of free moves. The episode's rules: 9 cards, pick 5, everyone moves at once.
- Bump instead of knock-off. In the earlier game a shove with no room took a player out of the game. Here a robot only reboots at its last flag and keeps racing.
- A few board elements, done well, instead of many done quickly.
The measures (v1, 2026-10-09)
- Size: 964 lines in one script, 94 in the page and 91 in the stylesheet. No libraries and no build step.
- Races: six computer-played races finished in 7, 7, 9, 11, 12 and 14 rounds. The "Suggest" button (the same AI with no guessing) won 2 of the 6.
- Phone: the board fits a 375-pixel-wide screen with no sideways scrolling.
- Data: none collected. No accounts, no cookies, no analytics, nothing stored and nothing sent. Everything runs in your browser.
- Still to measure: frame rate on a real phone, and the young-tester check ("add one board element in 15 minutes").
What we'd change next
- Draw a small curve where a belt bends, and show a "next register" arrow above each robot.
- Show a replay of the last register, which the Skeptic keeps asking for.
- Add Rewind and Quiet Mode, the episode's other two option chips.
- Add the fan gag: sometimes a "backup job" spins the fan up, and the whole floor freezes for a beat.
- A board picker for the rematch boards from the show (a cleanroom, and an orbital board with no gravity).
- A second view (3D) built on the same rules, as Don's earlier game did.
Make it your own
Everything you'd want to change sits near the top of floor9.js:
- A new board element: add a two-letter code to the map legend, read it in
tiles, add one entry toPHASES(what it does after each register), and draw it in part 6. A "teleporter" or "slippery oil" tile is a good first try. - A new robot: add a line to
CREWwith a name, a two-letter tag, a color, anoise(how much it guesses), and its two lines for the log. - A new option chip: add an entry to
CHIPS. A chip that is armed for one round sets a flag on the robot. Then use that flag in the rules. - A new floor: just edit the 12 map lines.
Open index.html in any browser. That's the whole setup, and it costs $0.