Not a full game, but a playable one. Probably buggy... (or full of crazy features, depending on if you're a 'glass half full kind of person')
I left a lot of comments on this script to help people understand better what is happening.
- You move by using the directional keys.
- If you hold any directional key, the snake will speed up. (I'll remove this in the future.)
- Snake will grow in size everytime you eat something.
- If you hit yourself or the borders of the screen, game over!
- To leave the game, press
ALT+X
Install the dependencies using the command:
pip install -r requirements.txt
If you're on Windows, you also need to install the requirements-windows.txt
file.
pip install -r requirements-windows.txt
Just run the main script.
python snake.py
python snake.py --log
or
python snake.py -l
- Create tests
- Show play area borders
- Print the name of the game
- Print (and update) the score