Split The code is public; the app answers only to the crew.
A whole match on a phone: fire while aiming, weapon switch, scoreboard and a way to leave #20
Sign in to join this conversation.
Split The code is public; the app answers only to the crew.
Make the touch build a client that can play a whole match: fire without lifting your aiming thumb, switch weapons, see the scoreboard, and leave a match without reloading the page.
On a phone today:
controls.onPauseis only ever called frompointerlockchange(src/client/input.ts), which a touch screen never fires, so there is no pause and no way out of a match; the touch pad has duck, jump, use, reload, buy and fire and no weapon switch or scoreboard; and the fire button sits in the same half of the canvas the look touch lives in, so firing means stopping aiming.Done looks like
#pauseoverlayEscapeopens, from which Leave match works. The slot buttons need no change toinput.ts:press.isDown("slot1")is whatslotWantedalready reads, andattachButtonsalready wires any[data-action].controls.onPauseis reachable without pointer lock.press.tsbehaviour for a fire held across a frame that also steers.bun testpasses; the README's controls section documents the touch controls next to the keys.Files I expect to change
src/pages/game.ts(the touch pad markup and its CSS),src/client/input.ts,src/client/press.test.tsor a newsrc/client/input.test.ts,src/client/main.ts,README.md.Risks
{ passive: false }and callpreventDefault; a control placed over the canvas can swallow the look touch or be handled twice (once as a pointer on the button, once as a touch on the canvas).lookX/lookYmust keep accumulating in exactly one place.press.clear()on blur and on unlock must not strand a held fire — a stuck trigger on a phone is unrecoverable without a reload.src/server.ts): every handler stays in the bundle, and[data-action]stays the way markup asks for behaviour.position: absoluteinside#stage; a taller pad eats the bottom of the view. Keep the playfield the same size it is now.Crew
scout — this is page markup, CSS and button wiring done small and finished, with the thing it left out named. If the two-finger aiming turns out to need real work inside the canvas touch handlers, vesper is the better fit.