add-multiplayer
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.
Core Principles
More from opusgamelabs/game-creator
game-designer
Game UI/UX designer that analyzes and improves the visual polish, atmosphere, and player experience of browser games. Use when a game needs visual improvements, better backgrounds, particles, animations, screen transitions, juice/feel, or overall aesthetic upgrades.
601game-assets
Game asset engineer that creates pixel art sprites, animated characters, and visual entities for browser games. Use when a game needs better character art, enemy sprites, item visuals, or any upgrade from basic geometric shapes to recognizable pixel art.
545phaser
>
501game-audio
Game audio engineer using Web Audio API for procedural music and sound effects in browser games. Zero dependencies. Use when adding music or SFX to a game.
469game-architecture
Game architecture patterns and best practices for browser games. Use when designing game systems, planning architecture, structuring a game project, or making architectural decisions about game code.
464design-game
Audit and improve the visual design, polish, and player experience of an existing game. Use when the user says "make my game look better", "improve the design", "add polish", "add juice", "add particles", "fix the UI", or "make it more visually appealing". Do NOT use for gameplay logic changes (use add-feature instead).
442