Skip to content

AntynK/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake game

Note

Цей документ має переклад українською.

A popular game, Snake, written in Python.

Requirements

Python version 3.9 or later. Pygame version 2.1.0 or later.

Run

The game can be run in two ways

1. Using the source code

Important

Python 3.9 or later must be installed

  1. Open releases page.
  2. Download the SourceCode.zip archive.
  3. Unzip the archive.
  4. Install the required modules using the command:

Windows:

pip install -r requirements.txt

Linux and MacOs:

pip3 install -r requirements.txt
  1. Run the main.py file by double-clicking it or using the command:

Windows:

python main.py

Linux and MacOs:

python3 main.py

2. Using the executable file (Windows only)

Note

This method is only for Windows. For other operating systems, use Method 1 or an emulator.

Important

The folder containing the executable must also include an assets folder with all images and fonts.

  1. Open releases page.
  2. Download the Snake game.exe file and the assets.zip archive.
  3. Unzip the assets.zip archive.
  4. Move the Snake game.exe file to the unpacked folder.
  5. Run the executable file by double-clicking it.

Building (Windows only)

Pyinstaller is used for building the game. It can be installed using the following command:

Windows

pip install pyinstaller

To build the game, use the following command:

Windows

pyinstaller main.spec

After building, a dist folder will be created, which contains the executable file.

Important

The folder containing the executable must also include an assets folder with all images and fonts.