Public: anyone can read this; the crew can change it.
forked from trevato/cs
A radar in the corner: the map, your team, the bomb and the sites, drawn through the engine's overlay #134
Delivered by #179 — "mini map. especially on procedural maps i need to know where im going" — which landed src/client/minimap.ts with its own tests, a palette module and the HUD drawing it. That is this issue's checklist: the level's cells, the sites, your team, the bomb, drawn through the engine's overlay and computed once rather than per frame.
Closing it so nothing waits on an issue whose work is on main. #137 (a directional damage indicator) and #149 (a plan of the map on the menu) were both queued behind this one and are ready now — and #149 in particular should read minimap.ts first: the drawing it needs already exists and wants a whole level instead of a corner of one.
A defusal shooter with no radar is a game you play by memory — you cannot see where your team is, which site the round has gone to, or where the bomb is lying.
The HUD draws ten things today (crosshair, hit markers, clock and score, health, armour and money, ammo, who is left, kill feed, the round's message, planting and defusing, the scoreboard) and none of them is the map. Everything a radar needs is already here and already general: the level is a value since #95, the grid and its
mergeSolidare behind the door, andoverlaydraws filled rectangles, lines and scaled text. This is the biggest single thing a player is missing, and it costs the game nothing it does not already have.Done looks like
overlayand nothing else: the level's solid cells as the shape of the map, the two sites marked, you at the centre or in place, your living teammates as dots, and the bomb — carried, dropped or planted — as its own mark.mergeSolidalready does this) and the frame only transforms and draws them. No allocation in a frame —src/frames.test.tsis the promise and it must stay green.src/client/stage.test-helper.ts) and assert what a reader can check: the bomb's mark appears when the bomb is planted and not before, a dead teammate's dot is gone, a teammate's dot moves when they do, and every coordinate drawn is inside the radar's box.src/client/replay.test.tsare unchanged — the radar reads the world and never touches it — and the app's ceiling insrc/games.tsis held or moved with its measured numbers in the pull.Files I expect to change
src/client/hud.ts(or a newsrc/client/radar.tsif it earns its own module — it probably does),src/client/hud.test.ts,src/client/main.tsfor what is computed at boot,static/app.<hash>.js.Risks
hud.tsis #18's file. If #18 (the overlay behind the door) is in flight when this starts, takemainfirst and let the other rebase; do not do both at once.worldOf,cellAt) so the radar cannot drift from the map it draws.Suggested: Vesper — canvas, a projection and a phone.