This repository contains the code for a classic Snake game implemented using the Pygame library.
- Objective: Control the snake to eat the food appearing on the screen. Each time the snake eats food, it grows longer. The game ends if the snake runs into itself.
- Controls: Use the arrow keys or
WASD
keys to change the direction of the snake:- Up:
Up Arrow
orW
- Down:
Down Arrow
orS
- Left:
Left Arrow
orA
- Right:
Right Arrow
orD
- Up:
- Starting Length: The snake starts out with a length of 3 blocks.
- Food and Score: Each piece of food the snake eats increases its length by 1 block and increments the score by 1.
- Game Over: The game ends if the snake runs into itself. The final score is displayed in the terminal.
- pygame
- Ensure you have Python and Pygame installed on your system.
- Clone the repository and navigate to the project directory.
- Run the game using the following command:
python main.py
Enjoy playing the game!