diffs / #4

feat(#4): the lobby

SHIPPED commit eb12a73 +24 −0 request “an arcade lobby” SEED · built by us pre-launch

Requested-by: SEED (built by us pre-launch)
+ BUILD+ UNIT TESTS+ LINT+ DIFF GATE+ PAGE CLASSIFIER+ PLAYWRIGHT
src/levels/lobby.jsNEW+24 −0
1+// Seed #4: the lobby of the arcade. A row of cabinets; the door on the left goes back up to the roof.
2+import { PAL } from "../palette.js";
3+import { blit } from "../sprites.js";
4+
5+export default {
6+ name: "lobby",
7+ label: "lobby",
8+ ground: 150,
9+ platforms: [{ x: 210, y: 118, w: 46 }],
10+ start: { x: 40, y: 150 },
11+ exits: {},
12+ doors: [{ x: 16, y: 138, to: "rooftop", at: { x: 60, y: 90 } }],
13+ boss: null,
14+ spawn: [],
15+ music: "lobby-a",
16+ draw(g) {
17+ g.fillStyle = PAL.skyDeep; g.fillRect(0, 0, 320, 180);
18+ g.fillStyle = PAL.wall; g.fillRect(0, 24, 320, 126);
19+ g.fillStyle = PAL.ink; g.fillRect(0, 150, 320, 30);
20+ for (let x = 0; x < 320; x += 16) { g.fillStyle = (x / 16) % 2 ? PAL.roof : PAL.far; g.fillRect(x, 150, 16, 4); }
21+ for (let i = 0; i < 6; i++) blit(g, "cabinet", 60 + i * 24, 136);
22+ g.fillStyle = PAL.roof; g.fillRect(210, 118, 46, 4);
23+ },
24+};
1+// Seed #4: the lobby of the arcade. A row of cabinets; the door on the left goes back up to the roof.
2+import { PAL } from "../palette.js";
3+import { blit } from "../sprites.js";
4+
5+export default {
6+ name: "lobby",
7+ label: "lobby",
8+ ground: 150,
9+ platforms: [{ x: 210, y: 118, w: 46 }],
10+ start: { x: 40, y: 150 },
11+ exits: {},
12+ doors: [{ x: 16, y: 138, to: "rooftop", at: { x: 60, y: 90 } }],
13+ boss: null,
14+ spawn: [],
15+ music: "lobby-a",
16+ draw(g) {
17+ g.fillStyle = PAL.skyDeep; g.fillRect(0, 0, 320, 180);
18+ g.fillStyle = PAL.wall; g.fillRect(0, 24, 320, 126);
19+ g.fillStyle = PAL.ink; g.fillRect(0, 150, 320, 30);
20+ for (let x = 0; x < 320; x += 16) { g.fillStyle = (x / 16) % 2 ? PAL.roof : PAL.far; g.fillRect(x, 150, 16, 4); }
21+ for (let i = 0; i < 6; i++) blit(g, "cabinet", 60 + i * 24, 136);
22+ g.fillStyle = PAL.roof; g.fillRect(210, 118, 46, 4);
23+ },
24+};
Before
BEFORE
After
AFTER
CI log tail
$ ci:build  (651 ms, exit 0)

$ ci:test  (208 ms, exit 0)
TAP version 13
# Subtest: palette: valid hex, at most 40 colours
ok 1 - palette: valid hex, at most 40 colours
  ---
  duration_ms: 1.357512
  type: 'test'
  ...
# Subtest: sprites: rectangular-ish rows of known keys
ok 2 - sprites: rectangular-ish rows of known keys
  ---
  duration_ms: 5.082796
  type: 'test'
  ...
# Subtest: levels: every room has a name, platforms and a draw function
ok 3 - levels: every room has a name, platforms and a draw function
  ---
  duration_ms: 4.06438
  type: 'test'
  ...
# Subtest: bosses: every file exports a class with update/draw
ok 4 - bosses: every file exports a class with update/draw
  ---
  duration_ms: 2.901202
  type: 'test'
  ...
# Subtest: features: default export with a unique id and only known hooks
ok 5 - features: default export with a unique id and only known hooks
  ---
  duration_ms: 2.11472
  type: 'test'
  ...
# Subtest: no network, storage or parent access anywhere in src
ok 6 - no network, storage or parent access anywhere in src
  ---
  duration_ms: 1.176492
  type: 'test'
  ...
1..6
# tests 6
# suites 0
# pass 6
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 125.281147

$ ci:lint  (619 ms, exit 0)

$ playwright 960x540  fps 60  long tasks 0  console errors 0