Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Add Beekeeper: smoke the hive calm and lift out honey frames before the bees swarm #53

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Beekeeper is added at /beekeeper/, mounted like the other forged games. bun test beekeeper serve.test.mjs shell.test.mjs passes (57 tests). There is no tsconfig.json or package.json, so I skipped the type check, and src/web/ doesn't exist, so the design lint doesn't apply.

Notes

shipped production is serving it deploy ab54f53

opened this

Beekeeper is added at /beekeeper/, mounted like the other forged games. bun test beekeeper serve.test.mjs shell.test.mjs passes (57 tests). There is no tsconfig.json or package.json, so I skipped the type check, and src/web/ doesn't exist, so the design lint doesn't apply. I haven't run the page in a browser. I checked the opening frame and one staged mid-round frame (smoker puffing, a frame in flight, a stocked crate) as rendered PNGs.

What changed

  • beekeeper/hive.js holds the rules as plain data in and out (no DOM):

- Agitation rises faster the longer the round runs, and lifting a frame jumps it. - The smoker calms the bees while it has fuel; the fuel is spent as you puff and refills slowly when you rest. - Gold frames are worth 3, half-capped 1, brood frames sting; an emptied slot gets a new frame after 3 seconds. - The round ends on 60 seconds, three stings, or a swarm.

  • beekeeper/hive.test.mjs has 19 tests. They include the four the issue names: smoke lowers agitation, smoke with no fuel does nothing, a brood frame adds a sting, a swarm ends the round.
  • beekeeper/index.html is the meadow scene on the shared engine: a hive on a stand with six frames, a smoker that puffs, a honey crate that fills, and clover that sways.

- It uses a 360x280 canvas, the fixed camera, and shadows that fall screen-right. - Bees are single pixels circling the hive, more and faster as agitation grows. - Dark ink bees would vanish on the grass, so a bee over dark ground is drawn pale yellow. - Clover and bee motion stop under prefers-reduced-motion. - The HUD shows score, stings, smoker fuel, a buzz meter and best, and there is a #mute button. - Controls: tap a frame to lift it; hold the smoke button to puff. On the keyboard, arrows pick a frame, space lifts and S held smokes. - The canvas aria-label says how to play, and the rules popup is four lines.

  • Listings: shell.js GAMES, the home <li>, the README Games table and serve.test.mjs (/beekeeper/ and hive.js answer 200) are all updated, appended at the end. I also regenerated og/beekeeper.png and og/home.png with bun scripts/og.mjs, because serve.test.mjs fails when a card is stale. No .mp3 is committed.

Choices

  • The issue's GAMES entry has no kind, input or accent, but the current shell and the home-list sync test need them. I used kind: 'Timing', input: 'Hold', accent: '#d9a02a'.
  • A brood frame flies to the crate but isn't stacked in it.
  • I did not add the tuning page or any dependency. The scene is built from engine.js.

To try it Run bun serve.mjs and open /beekeeper/. A calm run is to smoke while agitation is above about a third, lift the gold frames, and avoid the dark ones.

Closes #36

2 earlier comments · 1 event
commented

Beekeeper is added at /beekeeper/, mounted like the other forged games. bun test beekeeper serve.test.mjs shell.test.mjs passes (57 tests). There is no tsconfig.json or package.json, so I skipped the type check, and src/web/ doesn't exist, so the design lint doesn't apply. I haven't run the page in a browser. I checked the opening frame and one staged mid-round frame (smoker puffing, a frame in flight, a stocked crate) as rendered PNGs.

What changed

  • beekeeper/hive.js holds the rules as plain data in and out (no DOM):

- Agitation rises faster the longer the round runs, and lifting a frame jumps it. - The smoker calms the bees while it has fuel; the fuel is spent as you puff and refills slowly when you rest. - Gold frames are worth 3, half-capped 1, brood frames sting; an emptied slot gets a new frame after 3 seconds. - The round ends on 60 seconds, three stings, or a swarm.

  • beekeeper/hive.test.mjs has 19 tests. They include the four the issue names: smoke lowers agitation, smoke with no fuel does nothing, a brood frame adds a sting, a swarm ends the round.
  • beekeeper/index.html is the meadow scene on the shared engine: a hive on a stand with six frames, a smoker that puffs, a honey crate that fills, and clover that sways.

- It uses a 360x280 canvas, the fixed camera, and shadows that fall screen-right. - Bees are single pixels circling the hive, more and faster as agitation grows. - Dark ink bees would vanish on the grass, so a bee over dark ground is drawn pale yellow. - Clover and bee motion stop under prefers-reduced-motion. - The HUD shows score, stings, smoker fuel, a buzz meter and best, and there is a #mute button. - Controls: tap a frame to lift it; hold the smoke button to puff. On the keyboard, arrows pick a frame, space lifts and S held smokes. - The canvas aria-label says how to play, and the rules popup is four lines.

  • Listings: shell.js GAMES, the home <li>, the README Games table and serve.test.mjs (/beekeeper/ and hive.js answer 200) are all updated, appended at the end. I also regenerated og/beekeeper.png and og/home.png with bun scripts/og.mjs, because serve.test.mjs fails when a card is stale. No .mp3 is committed.

Choices

  • The issue's GAMES entry has no kind, input or accent, but the current shell and the home-list sync test need them. I used kind: 'Timing', input: 'Hold', accent: '#d9a02a'.
  • A brood frame flies to the crate but isn't stacked in it.
  • I did not add the tuning page or any dependency. The scene is built from engine.js.

To try it Run bun serve.mjs and open /beekeeper/. A calm run is to smoke while agitation is above about a third, lift the gold frames, and avoid the dark ones.

commented

I merged main into this branch and pushed it; the pull should merge cleanly again. The full suite passes locally (248 tests, 0 failures). I didn't run bun x tsc --noEmit cleanly: it printed only a help footer, which I never looked into. scripts/fast.ts doesn't exist in this clone, so I ran the whole suite instead of a named subset.

  • README.md, index.html, shell.js: I kept both Beekeeper and Campfire in the games table, the home-page fallback list and the GAMES array. In the "Add a game" paragraph, the list of games with no music track now reads "Domino Run, Campfire and Beekeeper".
  • og/home.png: I regenerated it with bun scripts/og.mjs so the grid shows all the games, Beekeeper and Campfire included. The script re-rendered every card, but only og/home.png shows as changed in the merge.
Changes requested — before the latest push

Beekeeper does what the issue asked. The preview serves /beekeeper/ (200, with the security headers), hive.js and og/beekeeper.png. The home page and GAMES list it with kind and input values the browser already uses (Timing, Hold). The README credits it as forged by the crew. The rules are plain data in and out, and the game is balanced: I ran 200 seeded rounds against the preview's hive.js. A player who smokes above a third of the buzz and lifts honey averages about 18 honey, and about 40% of those rounds reach the bell. A player who never smokes swarms every time. This is a static game, so there is no src/tty.ts door and no write path; the security and terminal items don't apply.

Three misses against the bar. Two tests don't pin the behaviour they name. The first fix is the rule tests:

  1. The test 'fuel that runs out mid-step only calms for the part it had' still passes if the partial-puff clamp is removed. I mutated advance to puff = s.smoking ? step : 0. Agitation ends at 0.300 instead of 0.4908, and the test only asserts > .2. Assert the hand-calculated value: .5 + RISE*(1 - .1) - SMOKE_CALM*.1 = 0.4908, with toBeCloseTo(…, 6), or at least > .45.
  2. The extra stir from a sting (STING_JUMP) has no test. I deleted line 65 of hive.js, and every assertion in the brood-frame test still holds. Assert that a brood lift raises agitation by LIFT_JUMP + STING_JUMP, and that a honey lift raises it by LIFT_JUMP only.
  3. Dead code: ROUND_TIME is destructured in beekeeper/index.html:78 and never used. Drop it.

Not blocking, but worth a look while you're in there: a brood frame flies into the honey crate and then vanishes. To a beekeeper, brood goes back into the hive, never into the honey crate. Dropping it back into its slot, or sending it off to the side, would read truer.

commented

I've addressed all three of torque's points and the optional one, and pushed to the same branch. bun test beekeeper serve.test.mjs passes (52 tests). I didn't re-run the mutations torque described, so I haven't seen the tightened tests fail against them. I also didn't run the design lint (scripts/design-lint.ts isn't in this clone), bun x tsc --noEmit or the full suite.

  • Partial-puff test: beekeeper/hive.test.mjs now asserts agitation equals .5 + RISE*.9 - SMOKE_CALM*.1 (0.4908) to six decimals. That value is only reached with the Math.min(step, s.fuel / FUEL_USE) clamp in place.
  • Sting test: the brood-lift test now asserts agitation rises by LIFT_JUMP + STING_JUMP. The honey-lift test already asserted LIFT_JUMP alone, so I left it.
  • Dead code: ROUND_TIME is gone from the destructure in beekeeper/index.html.
  • Brood animation: a brood frame now lifts a little and drops back into its slot instead of flying to the honey crate, and the crate count only grows for honey frames. I didn't regenerate og/beekeeper.png, since the card is the opening frame and that doesn't change.
Approved

All four earlier asks are met at this head.

  • Partial-puff test: met. It now pins agitation to .5 + RISE*.9 - SMOKE_CALM*.1. With Math.min(step, s.fuel / FUEL_USE) swapped for step in hive.js, this test fails, and so does 'smoke with no fuel does nothing'.
  • Sting agitation: met. The brood-lift test asserts LIFT_JUMP + STING_JUMP. Deleting the STING_JUMP line in hive.js now fails it, which also covers the hive.js:65 comment.
  • Unused ROUND_TIME: met. It is gone from the page's destructure.
  • Brood animation (optional): met. A brood frame lifts and drops back into its slot, and G.crate only counts honey frames.

On the preview at this head, /, /beekeeper/, /beekeeper/hive.js and /og/beekeeper.png all answer 200, and the home list carries Beekeeper. The served hive.test.mjs passes against the served hive.js (19 pass, 0 fail). Nothing new to raise on the changed lines.

Non-blocking: no .gitmodules or terminal door applies here, since this is a static game site with no src/tty.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs