Skip to main content

A simple snake game written in python.

Project description

Snakey

A simple snake game made with pygame with multiplayer option.

Running the game

To install Snakey, run the following command:

python -m pip install snakey

Then, to run the game, execute:

python -m snakey

A new window should appear where you and your friend can play a game of snake. Default keys for player one are , , and . Keys for player two are W, S, D and A.

Game configuration

Game configuration is defined with a json configuration file, by default, this configuration is set like this:

{
    "main_window_size": [640, 480],
	"block_size": 10,
    "refresh_rate": 100,
    "num_snakes": 2,
    "start_pos": [[300, 100],
			   [300, 200],
			   [300, 300],
			   [300, 400]],
    "keys": [["K_UP", "K_RIGHT", "K_DOWN", "K_LEFT"],
		     ["K_w", "K_d", "K_s", "K_a"],
		     ["K_t", "K_h", "K_g", "K_f"],
		     ["K_i", "K_l", "K_k", "K_j"]],
	"initial_snake_length": 10,
	"num_cherries": 2
}

In order to run the game with different configuration, create a new .json file, and modify the configuration there. Then, provide the path to the created file with --config option, like this

python -m snakey --config {path to configuration file}

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

snakey-2.1.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snakey-2.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file snakey-2.1.0.tar.gz.

File metadata

  • Download URL: snakey-2.1.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for snakey-2.1.0.tar.gz
Algorithm Hash digest
SHA256 63c25ee41f9523a701925cc20bc14f769c29e1e413d65da8d717be6de42f7500
MD5 1e0ff2bccb45830aff7b9d77d7ae7490
BLAKE2b-256 f8242dc980b5c662bcac69c1110f1272042e4f26926c6017c2ed8755d0a9f37f

See more details on using hashes here.

File details

Details for the file snakey-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: snakey-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for snakey-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 391a71039c4f6988039aa379258ed6cdb9b16511bc636b6f49e1807a5166188c
MD5 927f28aaadda53c9398c4a0685ba3baf
BLAKE2b-256 265a6f9c905b0a7d71864b5ed7bf312536258f92aecc513c53abf87d0e6a366e

See more details on using hashes here.

Supported by

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