Skip to content

Repository files navigation

ssnake — perpetual multiplayer snake

Play it live: https://ssnake.chimpvibe.dev

A tiny, fast, server-authoritative multiplayer snake. No lobbies, no rounds: join, eat, die, respawn, forever.

Features

  • 300 x 200 world with a camera that follows your snake, plus a minimap (bottom-right) showing every snake as a line.
  • Static obstacles: a walled plaza, bars, L/T shapes and pillars.
  • Proximity boost: get close to another snake and you ramp up to 2x speed (with a glow). Break away and it fades.
  • Heads with eyes, name labels in your snake's color, a crown for the leader.
  • One house bot, ssnakebot, is always on the board. Humans can't take its name.
  • Mobile: swipe to steer. Desktop: arrows or WASD. One collapsible menu holds score, players, tick rate and the leaderboard.

Run it

npm install
npm start          # http://localhost:3000

Environment variables (all optional):

var default meaning
PORT 3000 HTTP + WebSocket port
TICK_RATE 8 server ticks per second
BOTS 1 number of AI snakes (first is ssnakebot)
MAX_PLAYERS 40 human player cap

Health check: GET /healthz.

Layout

  • server/server.js — Node 24 + ws. Serves client/ and runs the game loop. Single file, no build.
  • client/index.html — the whole client: canvas renderer, camera, minimap, controls. Single file, no framework.
  • SPEC.md — the wire protocol and rules. Server and client were written against this contract.
  • Dockerfile / box.compose.yml — container packaging. The compose fragment targets the author's own Docker host; adapt or ignore it.

Protocol (short version)

Client → server: {"t":"join","name":"..."}, {"t":"dir","d":"up|down|left|right"}. Server → client: welcome (your id, grid size, tick ms, walls), state every tick (all players + food), dead, full. See SPEC.md for details.

License

MIT

About

Perpetual multiplayer snake: proximity boost, obstacles, minimap. Live at ssnake.chimpvibe.dev

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages