Quick multiplayer snake with Colyseus and Phaser.
Sprites by Bas de Reuver
Run locally:
cd server; npm run
cd client; npm run
Build client:
cd client; npx parcel build index.html --public-url /snake/ --dist-dir snake
-
Synchronize player movements
-
Spawn food
-
Client-side physics with server-side validation
-
Make snakes grow when they eat
-
Create death sequence
-
Fine-tune server-client sync
- Server validation should take snake tails into account
- Sync available food (for now: not synced with other players than the one who ate it)
-
Mobile-friendly (sort of)
- Same Phaser config as Quatre apparts?
- Mobile inputs cf. "Space"
-
Add a leaderboard
- React or Phaser? Phaser
- LeaderBoard template
- Connect with Player schema
- Sync score updates
- Update score after 200ms timeout, or at a timed interval
-
Start screen with debug toggle
-
Fixes
- Collide vs overlap for enemies
- Solve head vs tail issue: take head direction into account
- Head-to-head: both should die
-
Make it cleaner and better
- New players should not spawn directly in front of existing players
- Snake class should contain everything snake-related