https://github.com/yunzhu-li/multiplayer-snake
A multiplayer network snake game made with node.js and socket.io
https://github.com/yunzhu-li/multiplayer-snake
game multiplayer networking nodejs socket-io
Last synced: 11 months ago
JSON representation
A multiplayer network snake game made with node.js and socket.io
- Host: GitHub
- URL: https://github.com/yunzhu-li/multiplayer-snake
- Owner: yunzhu-li
- License: mit
- Created: 2016-06-22T02:14:06.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T07:31:49.000Z (about 3 years ago)
- Last Synced: 2025-07-31T19:37:15.645Z (11 months ago)
- Topics: game, multiplayer, networking, nodejs, socket-io
- Language: JavaScript
- Homepage: https://apps.yunzhu.li/snake/
- Size: 1.05 MB
- Stars: 13
- Watchers: 3
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
snake
-----
A network snake game synchronization made with nodejs and socket.io.
A **live demo** is available at: [https://apps.yunzhu.li/snake](https://apps.yunzhu.li/snake/)

Branches
-----
`master` - For low-latency networks (<100ms RTT). Simple and robust.
`rollback_and_prediction` - For high-latency networks. Using `rollback & prediction` non-blocking synchronization.
Run Your Own Copy
-----
This application is available as a docker image.
- Make sure you have access to `docker`.
- Run:
```
docker run -d --rm -p 8000:8000 -e SERVER_URI="http://:8000" yunzhu/snake
```
- Access `http://:8000` in your browser.
> The 2 environment variables `SERVER_URI` and `SOCKET_IO_PATH` (optional) are used to configure the socket.io connection info for the client page served by the container.
>
> The container always serves client page at `/` and socket.io connection at `/socket.io/`.
>
> See: https://socket.io/docs/client-api/#new-manager-url-options