A multiplayer Pong game built with Rust + WebGPU (client) and Cloudflare Durable Objects (server).
cargo install wasm-pack # Prerequisites: Rust, Node 20+
npx wrangler login # One-time Cloudflare auth
npm run build && npm run dev # http://localhost:8787| Mode | How |
|---|---|
| Multiplayer | Click CHALLENGE → share link → JOIN |
| VS AI | Click PLAY |
Controls: Arrow keys or W/S · Touch on mobile
Rules: First to 5. Hit position affects ball trajectory.
See ARCHITECTURE.md for the system diagram and component deep dive.
Key design decisions:
- Shared
game_core— Same ECS physics on client and server for prediction - Binary protocol — Minimal
postcardserialization over WebSocket - Durable Objects — Each match is a stateful instance with 60Hz game loop
pongo/
├── game_core/ # ECS game logic (hecs) — shared by client/server
├── proto/ # Network protocol (postcard)
├── client_wasm/ # WebGPU renderer (wgpu)
├── server_do/ # Durable Object server
├── lobby_worker/ # HTTP endpoints + routing
└── worker/ # Built WASM + assets
npm run build # Build WASM
npm run dev # Local server
npm run test # Run tests
npm run deploy # Deploy to Cloudflare| Issue | Fix |
|---|---|
| Build fails | cargo install wasm-pack |
| Port in use | Kill process or edit wrangler.toml |
| Reset state | Delete .wrangler/state/ |
See ARCHITECTURE.md for technical details and game constants.
MIT
