Skip to content
README.md 979 B
Newer Older
Anthony Jacob's avatar
Anthony Jacob committed
# python-snake

Anthony Jacob's avatar
Anthony Jacob committed
python-snake is a side project I developped in order to practice Python
Anthony Jacob's avatar
Anthony Jacob committed


Anthony Jacob's avatar
Anthony Jacob committed
## Installation
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
so far, the project is not using specific dependencies other than the basic python module
I developped it using Python 3.8.2
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
clone the repo with
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
```
git clone https://gitlab.anthony-jacob.com/anthony.jacob/python-snake.git
Anthony Jacob's avatar
Anthony Jacob committed
cd python-snake
Anthony Jacob's avatar
Anthony Jacob committed
python main.py
```
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
## Play
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
there is a intermediary menu where you can exit or choose the play mode (only in terminal for now)
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
to move the snake you can use the keyboard arrow 
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
### Customize the grid size
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
right know if the grid does not fit your terminal, you can change the size 
by editing the file **_pythonsnake/controller.py_** at line **32**
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
`        self.game = Game(50, 25)`
Anthony Jacob's avatar
Anthony Jacob committed


Anthony Jacob's avatar
Anthony Jacob committed
## Limitation
Anthony Jacob's avatar
Anthony Jacob committed

Anthony Jacob's avatar
Anthony Jacob committed
it is far from perfect but it is good enough to try 
this project is a proof of concept, some part could be improve
the refresh of the screen is blinking and the event listener for the control are not responsive all the time