# Snake Game
![image](https://user-images.githubusercontent.com/99841502/210010014-43e3dda0-8138-4f6b-a064-23a498c19472.png)
Description
This is a version of the Snake game programmed with Python using my Python Game Development Module and the PyGame library.
This project was my attempt at simple 2-D game development using object oriented programming. In addition, I used it to help build my game development module and demonstrate its application.
Features
- The snake can move around the screen using the arrow keys or W, A, S, D keys.
- The snake grows in length every time it devours a mouse by colliding with it.
- After a mouse is devoured, a new one spawns at a random location on the field.
- The game can be paused and resumed using the esc key.
- The game ends if the snake touches the edges of the screen or its own body.
- The player has the option to replay the game after it is over by pressing the enter key.
- The game can track and display the snake's length and the highest length so far. The highest length is updated in an external text file every time the game window is quit.
Installation
Prerequisites
- Download and install the latest version of Python that is compatible with PyGame.
- Check if python is properly installed along with its package installer using the following commands in your terminal:
$ python --version
$ python -m pip --version
- If the Python package installer, pip, is not installed, get it installed using the pip documentation.
-
Install the PyGame module by running the following command in your terminal:
pip install pygame
Usage
- Download the repository as a ZIP or clone the repository to your local device.
- On your terminal, change directory to the repository folder using the
cd
command.
-
Run the main.py
file using the command:
python main.py
Last Updated: January 09, 2023