add-multiplayer
Originally fromopusgamelabs/game-creator
Installation
SKILL.md
Add Multiplayer (PartyKit / Cloudflare Durable Objects)
Add real-time or turn-based multiplayer to an existing single-player browser game. This skill scaffolds:
- A PartyKit server (one Durable Object per room) deployed to Cloudflare's edge.
- A client
NetworkManagerwired through EventBus that mirrors the existingplayfun.jsexternal-service pattern. - Additive edits to
EventBus,GameState,Constants, andrender_game_to_text()— single-player gameplay must remain identical when the server is unreachable.
The default state is "single-player works." If the WebSocket connection fails, NetworkManager swallows the error and the game runs locally as before. When connected, remote players appear via network:player-joined and synchronize via network:state-received.
Reference Files
architecture.md— event taxonomy, GameState schema, NetworkManager contract, Phaser vs Three.js placement notes.partykit-server.md— server templates (realtime.tsandturn-based.ts), state shape, broadcast helpers, rate limiting.client-integration.md—MultiplayerClient,NetworkManager,RemotePlayerRegistrysource, EventBus/GameState/Constants append patterns,render_game_to_textextension.deploy.md—npx partykit devandnpx partykit deploywalkthrough, capturing the deployed URL,.envhandling, and client redeploy.