gitflarePublicPartly agent-ready40
sketch-rush
Multiplayer draw-and-guess game on Cloudflare Workers, Durable Objects and D1.
- LicenseApache-2.0
- LanguageJavaScript
- Last landed
dbe1e99Oct 23, 2026
dbe1e99Sketch Rush
Draw-and-guess party game (3–12 players) on one Cloudflare Worker + Durable Objects.
How to play
Quick play or create a private room and share the invite link. Each turn the drawer picks one of 3 words and draws it (80 s); others guess in chat. Faster guesses score more; the drawer earns points per correct guess. 3 rounds, then a podium and an automatic new game.
Run
npm install, npm run dev, npm test, npm run bots -- http://localhost:8787 --bots 4.
Architecture
src/index.tsroutes (/health,/api/rooms,/api/quickplay,/api/leaderboard,/ws/<CODE>);src/room.tsRoom DO (30 Hz alarm tick, hibernating WebSockets);src/lobby.tsroom directory;src/leaderboard.tsD1 (optional).public/shared/sim.jsdeterministic rules;protocol.jscodecs.- Client:
app.jsUI,net.js,render.js,input.js,tools.js,audio.js,fx.js,ui-helpers.js(pure helpers).
Protocol
Client: ["j",name,token,tick], ["d",seq,strokeId,color,size,...xy], ["u",seq], ["c",seq], ["g",seq,text], ["w",seq,idx], ["a",tick], ["p",ms].
Server: ["w",...] welcome, ["s",...] delta snapshot, ["k",epoch,fromOp,...ops] shared stroke ops, ["v",tick,...events] batched events, ["o",...] pong, ["e",code,msg].
Rate limit: token bucket 60/s, burst 90; 3 strikes close with 1008.
Security
CSP in public/_headers; all user text is rendered with textContent.
Local D1
src/leaderboard.ts creates the scores table on first use, so wrangler dev works as is. To apply migrations explicitly: wrangler d1 migrations apply DB --local.