Skip to main content

Snake game implementation for multiplayer and reinforcement learning

Project description

Snake Wars

Generic badge Travis CI Documentation Status

Snake game implementation for multiplayer and reinforcement learning.


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
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='', 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:

    image: joffreybvn/snake-wars-server
    container_name: snake-wars-server
    restart: unless-stopped
      PORT: 5071
      SLOTS: 2
      GRID_WIDTH: 20
      GRID_HEIGHT: 20
      FOOD_RATE: 0.15
      - "5071:5071"

With this configuration, the game will start only when two players are connected.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snake-wars-0.3.0.tar.gz (11.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page