Skip to content

Nazar0360/Snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake game

Everyone knows this game. I just decided to write it myself.

Controls

Use arrows to change direction of the snake movement, key P or Space to pause and R to reset. Use Esc to exit. To control the first snake use WASD keys, to control the second one use arrows, to the third one use tfgh, to the fourth one use ijkl (can be adjusted in config.ini).

New

  • Portals
  • 3-player and 4-player mode
  • game font can be changed by adding a new font to the Font folder and changing font_name field in config.ini

Game objects

Snake

Static snake head is a default texture of static snake head.
Moving snake head is a default texture of moving snake head.
Dead snake head is a default texture of dead snake head.
Snake tail is a default texture of snake tail.

Hue of all the textures can be changed.

Boosts

The The plus boost boost increases the length of the snake's tail and score by one.
Chance: 70%

The The minus boost boost decreases the length of the snake's tail by one.
Chance: 15%

The The random boost boost increases the length of the snake's tail by a number from -2 to 2, the score increases by the same number adding a number from -1 to 1.
Chance: 10%

The The wall destroyer boost boost destroys the quarter of all the walls and decreases the score by half of all destroyed walls.
Chance: 5%

Walls

Walls Wall are obstacles for snakes. If a snake crashes into the wall, it dies.

Portals

Portals Just a portal can teleport a snake to random portal with the same color. Used portals are moved.
Hue of portals texture can be changed.

Amount of different portals equal to amount of players (snakes).

Code

To run the game you neet to have python, and install all the required packages. To do it, open terminal in the project folder and enter pip install -r requirements.txt. Then run main.py file.\

*(main.py is the main file that runs the game, but it uses the console. If you don't need the console, run main.pyw instead.)

If you want to change the game and its rules, you can just adjust different values in config.ini.

Texture Packs

To create a texture pack, go to Texture Packs, create a folder and put there images with the same names as in Default. Then open config.ini, and write the name of created folder in Game section in texture_pack_name instead of Default.

Debug

prof.py writes information about execution time of functions and methods to stats.prof. To view this information, open terminal in Debug folder and enter snakeviz .\stats.prof (or python.exe -m snakeviz .\stats.prof).

Discussions

If you have ideas or questions write them on the discussions.

Issues

If you find a bug or other issue write about it on the issues.

Releases

No releases published

Packages

No packages published

Languages