Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
A third game, served: /example proves a game now costs one entry and one page #119
Check · Review · Land · Live done — Landed and live in production.
Pushed. `bun test` is green: 570 tests, 0 failures.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
Pushed.
bun testis green: 570 tests, 0 failures./exampleserves the guide's own game —src/engine/example.ts, shared and not copied — as the third game in the registry. It cost one entry insrc/games.ts, onesrc/pages/example.ts, one line in the server'sRENDERmap (no new branch), and 198 lines of wiring insrc/example/:main.tsfinds the canvas, hands the engine's controls the game's own bindings table plus the one key that starts a run, runs the fixed loop and calls the game'sstep;plan.tsdraws the room from above through the engine'soverlayand nothing else — filled rectangles for the floor, the plate and the aim, a crosshair for you, a bar for the countdown, the overlay's ownm:ss. 2D on one canvas: no WebGL, no atlas, no sound, no cookie. Its bundle is 8,754 raw / 4,229 gzipped against the shooter's 71,646, under a stated ceiling of 9,700 / 4,700; neither other bundle moved a byte. The nav, the 404 and both other pages picked it up from the registry with nothing edited, which is what the registry-driven tests insrc/server.test.tsalready assert in a loop.Two things to look at. First, sharing the example cost one line in
src/engine/boundary.test.ts: the guide's game is not a module of the package and is not behind the door, so the rule now letssrc/example/— and onlysrc/example/— namesrc/engine/example.tsby path, with a test pinning that narrowness both ways.index.tsis untouched and the engine's surface list did not move; if you would rather the finding had been an issue than a widened rule, this is the line to argue with. Second,src/engine/page.test.ts's liveness check read"webgl2"out of every committed bundle, which a 2D game legitimately has none of — that test was wrong for a third game, so it now reads"getContext"per bundle and separately counts the two that do draw in 3D.scripts/build.test.tsandsrc/pages/shell.test.tseach gained the third entry they pin by hand.What I did not do: no facility was added to the engine, no
src/example/module importssrc/client/orsrc/range/(src/independence.test.tsgained assertions but no rule), and the example's game logic, its tests and the guide's code blocks are unchanged. In the preview,/exampleis one screen — press Enter or Start, arrows turn,Spacefires — and the section under it is the price tag; the README's "What a third game cost" table has the same numbers in files, lines and bytes.🤖 Generated with Claude Code
Closes #80