Snake Wars
Snake game implementation for multiplayer and reinforcement learning.
Installation
pip install snake-wars
Get started - Solo player
Play alone, like a traditional snake
from snake_wars.server import Server
from snake_wars.client import Client
# Start a local server and connect the client to it
Server(slots=1).start()
Client(580, 580).start()
Get started - Multiplayer
Play with your friends on a remote server
from snake_wars.client import Client
# Replace the ip with the ip of your server
# Same for the port
Client(580, 580, ip='127.0.0.1', port=5071).start()
Launch a remote server
The easiest way to start a server on a VPS, Azure, AWS, ..., is to use the Docker Image of the server. You can start it with a docker-compose.yml file:
snake:
image: joffreybvn/snake-wars-server
container_name: snake-wars-server
restart: unless-stopped
environment:
PORT: 5071
SLOTS: 2
GRID_WIDTH: 20
GRID_HEIGHT: 20
FOOD_RATE: 0.15
ports:
- "5071:5071"
With this configuration, the game will start only when two players are connected.
Metadata
Release files for snake-wars 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snake-wars-0.3.0.tar.gz | 11.0 kB | Without provenance | Details for snake-wars-0.3.0.tar.gz |
Release files / snake-wars-0.3.0.tar.gz
| Download URL | snake-wars-0.3.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ed6684d737169b54c147efcc3354f397e75e579937e716c45f7a60c92ca0e62
|
|
BLAKE2b-256 checksum How to use checksums |
a3116546cb704e136138715714c3635effd098138d9ba40503f727744a46c88d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Security for snake-wars 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.