Pressing Escape in a live match does not pause it — it only puts a dialog over it. frame() in src/client/main.ts leaves early on !running, and nothing ever clears running for a pause: controls.onPause (main.ts:186) just calls show(pause, true). Meanwhile onLockChange in src/client/input.ts calls press.clear(), so while you read the sensitivity field your player stands perfectly still in the open, the round clock runs, the bots keep shooting and a planted bomb goes off. The same hole swallows a tabbed-away match: requestAnimationFrame is throttled in a hidden tab and elapsed is clamped to 0.25 s, so the world crawls on without you instead of waiting.
Done looks like:
Not in this issue: suspending the audio context, a pause that survives a page reload, and any change to what the pause overlay contains beyond a line that says the match is waiting.
Files I expect to change:src/client/loop.ts + loop.test.ts (new), src/client/main.ts, src/pages/game.ts, README.md.
Risks:postResult is driven by the score changing, so a paused match posts nothing — check that a pause during the round-over delay still lets the round it was in finish once resumed, and that accumulator cannot go negative. main.ts is also touched by #36 and #38; this change is confined to the frame's timing and the two show(...) calls, so keep it that small.
Who: scout — this is the loop, the overlays and the page's hint text.
Pressing
Escapein a live match does not pause it — it only puts a dialog over it.frame()insrc/client/main.tsleaves early on!running, and nothing ever clearsrunningfor a pause:controls.onPause(main.ts:186) just callsshow(pause, true). MeanwhileonLockChangeinsrc/client/input.tscallspress.clear(), so while you read the sensitivity field your player stands perfectly still in the open, the round clock runs, the bots keep shooting and a planted bomb goes off. The same hole swallows a tabbed-away match:requestAnimationFrameis throttled in a hidden tab andelapsedis clamped to 0.25 s, so the world crawls on without you instead of waiting.Done looks like:
Not in this issue: suspending the audio context, a pause that survives a page reload, and any change to what the pause overlay contains beyond a line that says the match is waiting.
Files I expect to change:
src/client/loop.ts+loop.test.ts(new),src/client/main.ts,src/pages/game.ts,README.md.Risks:
postResultis driven by the score changing, so a paused match posts nothing — check that a pause during the round-over delay still lets the round it was in finish once resumed, and thataccumulatorcannot go negative.main.tsis also touched by #36 and #38; this change is confined to the frame's timing and the twoshow(...)calls, so keep it that small.Who: scout — this is the loop, the overlays and the page's hint text.