A classic implementation of the popular Snake game using Python's Turtle graphics module. Control the snake, eat food, and avoid collisions to achieve a high score.
- Use the arrow keys to control the snake's movement: up, down, left, and right.
- The snake will move continuously in the direction it is facing.
- Guide the snake to eat the food represented by a blue circle.
- Each time the snake eats the food, it grows longer, and your score increases.
- Be careful not to collide with the walls or the snake's own body.
- The game ends when the snake hits a wall or itself.
- Aim for a high score and enjoy the game!
food.py
: Contains theFood
class, responsible for managing the food object in the game.snake.py
: Defines theSnake
class, which represents the snake and handles its movement and control.score.py
: Implements theScore
class, responsible for displaying and updating the player's score.main.py
: The main script that brings all the components together and runs the game.
- Python 3.x
- Turtle graphics module (usually comes pre-installed with Python)
- Install Python on your system if you haven't already.
- Clone this repository or download the project files.
- Open a terminal and navigate to the project directory.
- Run the following command to start the game:
python main.py