Split The code is public; the app answers only to the crew.

Death and the end of the match read right: spectate the player you are watching, and show the result #16

Merged opened this

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

Merged

drawHud now takes the player it draws instead of reaching for world.me, so a dead player watches a teammate with that teammate's health, armour, ammo and gun under the view — no crosshair, no hit markers inherited from the corpse, a red line naming who killed you and with what (read from the kill feed by id, not by nam…

Notes

shipped merged

opened this

drawHud now takes the player it draws instead of reaching for world.me, so a dead player watches a teammate with that teammate's health, armour, ammo and gun under the view — no crosshair, no hit markers inherited from the corpse, a red line naming who killed you and with what (read from the kill feed by id, not by name), and "Watching <name> — fire or click for the next". Fire or a click cycles through the living teammates; the camera also moves itself along when the one you are watching dies, and sound now comes from where the camera is rather than from the body. The round result stays on screen through the end delay and the freeze that follows, instead of fading after four seconds.

At match_over a DOM overlay in #stage says who won, the final score from your side and your kills, deaths, headshots and damage, with Play again and Back to menu — focus lands on the first button, both are the page's 44px controls, and nothing takes pointer lock back. It goes up after postResult(true) resolves either way, so a leaderboard that cannot be reached does not hide the scoreline. That post is new in another sense: the score total increments when the round ends, so the old played !== posted check never fired again once the phase turned match_over and no match was ever posted as finished — which is what standings counts wins from.

Two new headless modules with tests: src/client/spectate.ts (who you watch, who killed you) and src/client/summary.ts (summarize(world), a pure function giving the winner, the score the person's way round and their line); FeedEntry gained killerId/victimId so a player sharing a bot's name cannot be handed the wrong killer. bun test is 163 pass / 0 fail and the bundle is rebuilt and committed (the build drops the stale app.*.js files it found, as it is written to). Worth a look in the preview: die early in a round and cycle teammates with the mouse, then run a short match to the end for the card.

🤖 Generated with Claude Code

Closes #11

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs