No description
  • Rust 69.4%
  • JavaScript 18.7%
  • CSS 7.1%
  • HTML 2.5%
  • Makefile 1.8%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-17 15:25:11 +02:00
src Kick idle players after timeout 2026-06-17 15:08:01 +02:00
static Add mobile touch controls and client-side paddle prediction 2026-06-12 11:37:47 +02:00
.dockerignore Add paddle deflection physics and Docker deployment setup 2026-06-11 19:16:06 +02:00
.gitignore Add multiplayer polygon Pong with Rust, DataStar, and WebSocket. 2026-06-11 09:35:44 +01:00
Cargo.lock Add multiplayer polygon Pong with Rust, DataStar, and WebSocket. 2026-06-11 09:35:44 +01:00
Cargo.toml Add multiplayer polygon Pong with Rust, DataStar, and WebSocket. 2026-06-11 09:35:44 +01:00
docker-compose.yml Add paddle deflection physics and Docker deployment setup 2026-06-11 19:16:06 +02:00
Dockerfile Add paddle deflection physics and Docker deployment setup 2026-06-11 19:16:06 +02:00
Makefile Add paddle deflection physics and Docker deployment setup 2026-06-11 19:16:06 +02:00
poong.jpg Add screenshot to README 2026-06-17 15:25:11 +02:00
README.md Add screenshot to README 2026-06-17 15:25:11 +02:00

p∞ng

Multiplayer polygon Pong — one always-on arena where players sit on the edges of a regular N-gon (minimum 4 sides, up to 32 players). Each player has their own ball and scores by shooting it into another player's goal. Every client sees the arena from their own perspective with their paddle at the bottom.

p∞ng screenshot

Stack

  • Rust + Axum — game simulation, HTTP, WebSocket, SSE
  • Datastar — real-time scoreboard and activity feed via SSE
  • WebSocket — paddle input and game state at ~30 Hz
  • Canvas — POV-rotated arena rendering

Run

cargo run

Open http://localhost:8197 in one or more browser tabs. Use ← → (or A / D) to move your paddle.

Architecture

Transport Purpose
POST /join Drop-in join with optional reconnect via player_id
GET /events Datastar SSE — scoreboard, activity feed, player count
GET /ws?player_id= Game state snapshots + paddle input

Empty edges on a sub-4-player quadrilateral are solid walls. When a player leaves, the polygon reshapes after a 30s reconnect window.