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

forked from trevato/cs · proposes · 4 behind · 3 other forks

Buying never takes the mouse off the game: number keys in the buy menu, and a rebuy #153

shipped production is serving it opened this has it

Landed in pull #274 · run

opened this

Every round starts by giving the mouse back to the desktop. openBuy calls doc.exitPointerLock(), moves focus to the first button and waits for a click — so buying costs a pointer round-trip, twice a round, in a game whose whole feel is that the mouse is your hand.

In Counter-Strike you buy blind, with the keyboard, while you are already walking out of spawn. The panel here is good — prices honest, rebuilt on open, unaffordable items disabled — it just insists on the cursor.

Done looks like

Files I expect to change

src/client/main.ts, src/client/binding.ts (the keys), src/client/main.test.ts, src/pages/game.ts (the hint), static/app.<hash>.js.

Risks

  • Keeping the lock means the keys must not also drive the player: while the panel is open, movement and fire are already suppressed — extend that, do not add a second input path.
  • The numbering must match what is on the screen. Number the items where they are rendered, from the same list, so the two cannot disagree.

Suggested: Vesper — input that feels immediate is the brief.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs