Note
Цей документ має переклад українською.
A popular game, Snake, written in Python.
Python version 3.9 or later. Pygame version 2.1.0 or later.
The game can be run in two ways
Important
Python 3.9 or later must be installed
- Open releases page.
- Download the
SourceCode.zip
archive. - Unzip the archive.
- Install the required modules using the command:
pip install -r requirements.txt
pip3 install -r requirements.txt
- Run the
main.py
file by double-clicking it or using the command:
python main.py
python3 main.py
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.
- Open releases page.
- Download the
Snake game.exe
file and theassets.zip
archive. - Unzip the
assets.zip
archive. - Move the
Snake game.exe
file to the unpacked folder. - Run the executable file by double-clicking it.
Pyinstaller is used for building the game. It can be installed using the following command:
pip install pyinstaller
To build the game, use the following command:
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.