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

The round history strip: which rounds you lost, and how #97

look green — its tests passed, ready for a look opened this
opened this

MatchState (src/client/match.ts:52) keeps winner and reason for the round that just ended and nothing before it, so by round seven the match has no memory: you cannot see that you lost three to the clock, or that the only round you took was a defuse. The strip of round marks is how a CS player reads a match at a glance, and every number it needs is already produced by endRound.

Done looks like

  • [ ] MatchState grows a history of { winner, reason }, appended by endRound and by nothing else, one entry per round in the order they were played, and it survives half time — the sides swap, the history does not.
  • [ ] The HUD draws it under the score bar: one mark per round, tinted by the side that won it, with the reason readable (a letter or a shape for detonated, defused, eliminated, time), and the round being played marked as unfinished.
  • [ ] It fits: at 360 px wide it stays inside the top bar and touches neither the clock nor the kill feed, and a 30-round competitive match still fits on one line. Say in the pull which way you made it fit.
  • [ ] The strip is drawn for the match, not for the player whose eyes you are borrowing — spectating a teammate does not change it.
  • [ ] Drawing it costs one path per round at most: no second canvas, no per-frame allocation.
  • [ ] src/client/match.test.ts covers the append, its order and the half-time swap; src/client/hud.test.ts covers that the marks are drawn for the rounds played and stay inside their box. Both fail without the change.
  • [ ] Nothing new is sent to the server: src/result.ts's shape is untouched.

Files I expect to change: src/client/match.ts, src/client/hud.ts, src/client/match.test.ts, src/client/hud.test.ts.

Risks: hud.ts is also the subject of #91 (name plates), which changes drawHud's signature — whichever lands second rebases; summarize and the round report read MatchState, so adding a field must not change what they already show; and a history that grows without a bound is a leak in a long match — thirty rounds is the ceiling the rules impose, so say that it is bounded rather than trusting it.

Brief that fits: vesper.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs