1–4 phones become motion-controlled swords slicing shapes on a shared screen. Fruit Ninja
meets Wii, in the browser. Bun only — Bun.serve, Bun WebSockets, bun build.
Screen (/) is the shared display; phone (/play) is the controller — point it at the
screen and swing to slice.
Bun comes from the flake if you want it — nix develop (or direnv allow; the .envrc
runs use flake). Otherwise install Bun yourself.
bun install
bun run dev # build + watch clients + run serverOpen http://localhost:3000/ (screen) and /play (phone). localhost is a secure context,
so desktop testing needs no HTTPS. Build/serve: bun run build, bun run start, PORT=8080 ….
iOS exposes the motion sensor only over HTTPS, so phones need a secure URL — put it behind nginx + TLS. On the same secure origin, open the screen, scan the QR per phone.
Scan / type the 4-letter code, name, ready up (or host presses space). Mode auto-selects: solo = survival (3 lives), versus = 90s race, first slice scores, golden +150, bomb −100. Only fast swings cut; tap recenter to calibrate aim.