This repository contains a classic Snake game implemented in Python using the Pygame library. The game features a simple snake that grows in length as it eats food, with the game ending if the snake runs into the game window edges or into itself.
- Simple Controls: Use the arrow keys to control the snake.
- Score Tracking: The game keeps track of your score based on the length of the snake.
- Game Over Screen: Provides options to either quit the game or play again after losing.
To run this game, you need Python installed on your computer along with the Pygame library. You can install Pygame using pip:
pip install pygameClone this repository to your local machine:
git clone https://github.com/fmachta/python-snake-game.git
cd python-snake-gameRun the game using Python:
python snake_game.py- Use the arrow keys (←, ↑, →, ↓) to control the movement of the snake.
- Eat the red squares (food) to increase the length of the snake.
- Avoid hitting the game window edges and the snake's own body.
- The game ends if the snake hits the wall or itself, and your score is displayed on the game over screen.
- Press 'Q' to quit or 'C' to play again after the game is over.