Licensed under the MIT License. See LICENSE.
A TypeScript monorepo for a modern multiplayer Snake game with:
- Solo play
- Local couch multiplayer for 2–4 players
- Online rooms over Socket.IO
- Competitive and party modes
- Phaser rendering in the browser
- A lightweight Node/Express + Socket.IO game server
apps/
client/ Phaser + Vite frontend
server/ Node + Socket.IO room server
packages/
shared/ Shared game and protocol types
- TypeScript
- Vite
- Phaser 3
- Socket.IO
- Node.js
- npm workspaces
npm installnpm run dev:serverThis starts the room server on http://localhost:3000 by default.
Open a second terminal and run:
npm run dev:clientThen open the local Vite URL shown in the terminal.
npm run buildnpm run typecheck- Launch the client.
- Choose Competitive or Party mode.
- Pick a difficulty and skin.
- Click Start Solo.
- Set Local players to 2, 3, or 4.
- Click Start Local.
- Controls by player:
- Player 1: Arrow keys
- Player 2:
W A S D - Player 3:
I J K L - Player 4:
T F G H
- Start the server.
- In the client, leave the server URL as
http://localhost:3000or change it. - Click Create Online Room on one machine/tab.
- Share the room code.
- Other players enter the code and click Join.
- Ready up and start the match.
- Classic elimination-focused Snake
- Last surviving snake or best score wins
- Adds temporary item effects such as boost, slow, shield, bonus, and warp
- More chaotic multiplayer rounds
- The client and server use separate simulation paths today: local play runs a client-side simulation, while online play mirrors server room state.
- Production client builds are currently large because Phaser is bundled into a big chunk.
At the repo root:
npm run dev:client
npm run dev:server
npm run build
npm run typecheckThis project is licensed under the MIT License.
See LICENSE for the full text.