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

Migrated from github.com/amirmushichge/pixel-plays

Add Window Washer: squeegee a grimy window clean before the cradle drops a floor #38

Merged opened this

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

Merged

Window Washer is added and pushed. bun test passes (162 tests) and I checked the page in a stand-in browser run. Chromium wouldn't start in the sandbox, so I ran the page script against a stub canvas and looked at the frames it drew.

Notes

shipped production is serving it deploy ab54f53

opened this

Window Washer is added and pushed. bun test passes (162 tests) and I checked the page in a stand-in browser run. Chromium wouldn't start in the sandbox, so I ran the page script against a stub canvas and looked at the frames it drew. I never ran it with real pointer or keyboard input.

What changed

  • Scene: window-washer/index.html draws a brick corner with five windows and a cradle hanging on two ropes, on a 360x280 canvas at the fixed 30° camera. Shadows fall screen-right, and a geranium box on each sill sways at 8 fps. The sway stops under prefers-reduced-motion.
  • Controls: drag across the glass to wipe, or hold space and use the arrow keys (WASD also works). #mute is there, no .mp3 is committed, and the rules popup is three lines.
  • Rules: window-washer/glass.js holds the grime mask, the squeegee footprint, two-pass droppings, the wet streak that dries after 2.5 s, percentage clean and the 12-second floor timer. The page owns only drawing and input.
  • Tests: glass.test.mjs shows one stroke across the middle cleans the cells under it and no others, a dropping needs two separate strokes, and a fully wiped window scores 100.
  • Registration: the game is added to GAMES in shell.js, to the home list in index.html, to the README Games table and add-a-game note, and to serve.test.mjs.

Choices

  • Each glass cell is one canvas pixel, so a window is 37×26 cells.
  • A new stroke starts at each pointer-down or space-down. That is why a dropping needs two separate strokes: back and forth within one stroke counts once.
  • A window's score is the whole-number percentage of clean cells, rounded down, so 100 means every cell is clean.
  • The HUD total counts finished windows plus the live percentage of the current one; the maximum is 500.
  • Upcoming windows are drawn grimy from the same seed they'll use when the cradle reaches them.

Left out

  • There is no washer figure on the platform.
  • There is no mullion in the glass.
  • There is no sound beyond a squeak and a floor chime.
  • The repo has no scripts/ or tsc setup, so I ran only bun test.

Try it: bun serve.mjs, then open /window-washer/.

🤖 Generated with Claude Code

Closes #30

2 earlier comments · 1 event
commented

Window Washer is added and pushed. bun test passes (162 tests) and I checked the page in a stand-in browser run. Chromium wouldn't start in the sandbox, so I ran the page script against a stub canvas and looked at the frames it drew. I never ran it with real pointer or keyboard input.

What changed

  • Scene: window-washer/index.html draws a brick corner with five windows and a cradle hanging on two ropes, on a 360x280 canvas at the fixed 30° camera. Shadows fall screen-right, and a geranium box on each sill sways at 8 fps. The sway stops under prefers-reduced-motion.
  • Controls: drag across the glass to wipe, or hold space and use the arrow keys (WASD also works). #mute is there, no .mp3 is committed, and the rules popup is three lines.
  • Rules: window-washer/glass.js holds the grime mask, the squeegee footprint, two-pass droppings, the wet streak that dries after 2.5 s, percentage clean and the 12-second floor timer. The page owns only drawing and input.
  • Tests: glass.test.mjs shows one stroke across the middle cleans the cells under it and no others, a dropping needs two separate strokes, and a fully wiped window scores 100.
  • Registration: the game is added to GAMES in shell.js, to the home list in index.html, to the README Games table and add-a-game note, and to serve.test.mjs.

Choices

  • Each glass cell is one canvas pixel, so a window is 37×26 cells.
  • A new stroke starts at each pointer-down or space-down. That is why a dropping needs two separate strokes: back and forth within one stroke counts once.
  • A window's score is the whole-number percentage of clean cells, rounded down, so 100 means every cell is clean.
  • The HUD total counts finished windows plus the live percentage of the current one; the maximum is 500.
  • Upcoming windows are drawn grimy from the same seed they'll use when the cradle reaches them.

Left out

  • There is no washer figure on the platform.
  • There is no mullion in the glass.
  • There is no sound beyond a squeak and a floor chime.
  • The repo has no scripts/ or tsc setup, so I ran only bun test.

Try it: bun serve.mjs, then open /window-washer/.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed it. The three conflicts are resolved, and the tests pass (173 pass, 0 fail). bun x tsc --noEmit printed nothing, so there were no type errors. I haven't checked the preview or the forge's check result.

The conflicts in README.md, index.html and shell.js were all the same kind: this pull added Window Washer next to where main added Market Scale. I kept both games in each file. In the README paragraph on adding a game, I changed the list of games that play on their own sound effects to end "Lighthouse, Market Scale and Window Washer".

The untracked dotfiles in the clone (.bash_profile, .bashrc, .claude/ and similar) are not part of the commit.

Changes requested — before the latest push

Most of this is solid. The preview answers 200 on /, /window-washer/ and glass.js, and the home list shows the game with the forged credit. The tests at the head pass (29 across glass, serve and shell). I rendered a frame headlessly from the engine and the page script, which drives update/draw with simulated drags: the brick corner, five windows, cradle on ropes, geranium boxes and the screen-right shadow all draw as the issue asks. The rules module is clean and plain-data. This static app has no auth, writes or tty, so those parts of the checklist don't apply.

I found three bugs a player will hit. Please fix all of them in this round:

  1. Fix first: the hover squeegee doesn't follow the mouse. pointermove sets G.hover and then returns unless dragging, so G.cur never moves. On desktop the squeegee is drawn parked at the centre of the glass (or wherever the last drag ended) while the cursor is somewhere else. Update G.cur = cellAt(e) on every move while the round is on, and only wipe when dragging.
  1. Finished windows stay wet forever. advance only dries s.window. When the cradle drops, the old window goes into G.done with its wet values frozen. I checked: stroke at 11.5 s, advance 10.5 s more, and max(wet) on the finished window is still 2. Any streak made in a window's last 2.5 s stays white on that window for the rest of the round. The issue says the streak dries. Either dry the finished windows too, or clear wet when scoring. Add a glass test that fails today.
  1. The status line's messages are never seen. HINT (set at boot and on restart) and window N: P% clean (set on the score event) are overwritten on the next frame by the window N of 5 · Xs · P% clean line, because that runs on every frame with no events. So the per-window score never shows, and the controls hint is dead code. Either hold the score/hint message for a moment, or drop them. While there, if (events.length) renderHud(); else if (R.phase === 'play') renderHud(); can be one condition.

Minor: groundColor takes an unused i parameter.

commented

I fixed all three bugs and the minor point, and pushed the branch. The window-washer, serve and shell tests pass (30). I haven't looked at the preview. bun scripts/design-lint.ts isn't in this clone, so I couldn't run it. bun x tsc --noEmit printed only its usage text, which looks like there's no tsconfig, so it checked nothing.

  1. Hover squeegee (window-washer/index.html): pointermove now sets G.cur on every move while the round is on, and only wipes when dragging. The drawn squeegee follows the mouse.
  2. Finished windows stay wet (window-washer/glass.js): advance now clears wet on the window it scores, so a late streak no longer stays white on a finished window. The new test a window scored with a late streak is left dry in window-washer/glass.test.mjs strokes in the last second, advances past the drop, and checks max(wet) is 0. It fails without the fix.
  3. Status line: the controls hint (boot and restart) and the window N: P% clean score message now go through a new note(), which holds them for 2.5 s before the per-frame window N of 5 · Xs · P% clean line takes over again. I kept both messages instead of dropping them. The two renderHud lines are now one condition.
  4. Minor: I removed the unused i parameter from groundColor.
Approved

All four asks from my last review (head 3d697f9) are met at bf77209. The window-washer and serve tests pass at this head (26 pass, 0 fail). The preview answers 200 on /, /window-washer/, glass.js and shell.js, and it serves this head's code (wet.fill(0) and noteUntil are both there).

  1. Hover squeegee: met. pointermove now sets G.cur on every move while the round is on, and only wipes when dragging. The drawn squeegee follows the cursor.
  2. Finished windows stay wet: met. advance clears wet on the window it scores. The new test a window scored with a late streak is left dry would fail without the fix: dry leaves 1.5 on the late streak before scoring, so the final max(wet) would not be 0.
  3. Status messages never seen: met. note() holds the hint and the window N: P% clean message for 2.5 s before the per-frame line takes over. At round end the over message still replaces it straight away, which is right. The two renderHud branches are now one condition.
  4. Minor: met. The unused i parameter is gone from groundColor.

Nothing new in the changed lines. This is a static app with no auth, writes or tty, so those checklist items don't apply. The game is registered in GAMES, the home list and the README, with the forged credit.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs