____ _ _ _
/ ___|| |_ _| |_| |__
\___ \| | | | | __| '_ \
___) | | |_| | |_| | | |
|____/|_|\__, |\__|_| |_|
|___/ Slyth
Multiplayer snake game written in Python
TO-DO:
- Server
- Web client (written on JS)
- Text chat
- Mobile web client (optimize for mobile devices)
- Leaderboard
Tested on python 3.11
git clone https://github.com/Arizel79/Multiplayer-snake-game.git
cd Multiplayer-snake-game
This project uses UV for Python package management, but you can also use plain pip.
uv sync
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
pip install -e .
You can edit config.yaml to configure server
uv run server
python main.py
Use Flask server only for development. Using UV:
uv run web-server
If not using UV:
python src/web/web_server.py
Setup a web server (e.g., Nginx) to serve static files from the directory src/web/www. Below is a minimal Nginx configuration example:
server {
listen 80;
server_name localhost;
root /path/to/this/project/src/web/www;
index game.html;
location / {
try_files $uri $uri/ =405;
}
}Controls:
- WASD - move snake
- space - move faster
- T - open chat
- ESC - close chat
- TAB - open players list
Chat commands:
.q- disconnect from server/killme- kill self/kickme- kick self