Skip to content
/ pongo Public

Real-time multiplayer Pong on the edge. Built with Rust + WebAssembly, Cloudflare Durable Objects, and WebGPU. Featuring a shared deterministic game core and client-side prediction.

License

Notifications You must be signed in to change notification settings

rgilks/pongo

Repository files navigation

Pongo

A multiplayer Pong game built with Rust + WebGPU (client) and Cloudflare Durable Objects (server).

Play now →

Pongo gameplay

Buy Me a Coffee at ko-fi.com

Quick Start

cargo install wasm-pack       # Prerequisites: Rust, Node 20+
npx wrangler login            # One-time Cloudflare auth
npm run build && npm run dev  # http://localhost:8787

How to Play

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.

Architecture

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 postcard serialization over WebSocket
  • Durable Objects — Each match is a stateful instance with 60Hz game loop

Project Structure

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

Commands

npm run build        # Build WASM
npm run dev          # Local server
npm run test         # Run tests
npm run deploy       # Deploy to Cloudflare

Troubleshooting

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.

License

MIT

About

Real-time multiplayer Pong on the edge. Built with Rust + WebAssembly, Cloudflare Durable Objects, and WebGPU. Featuring a shared deterministic game core and client-side prediction.

Topics

Resources

License

Stars

Watchers

Forks