This is a classic Snake Game implemented in Python using the Turtle graphics library. The game involves controlling a snake to eat food and grow in size, while avoiding collisions with walls and its own tail.
- Classic snake gameplay
- Increasing difficulty as the snake grows
- Score tracking
- Simple and intuitive controls
-
Start the Game: Run the
main.py
file to start the game. -
Control the Snake:
- Use the Up arrow key to move up.
- Use the Down arrow key to move down.
- Use the Left arrow key to move left.
- Use the Right arrow key to move right.
-
Objective: Guide the snake to eat the food that appears on the screen. Each time the snake eats food, it grows in length.
-
Avoid Collisions:
- Do not let the snake hit the walls.
- Do not let the snake collide with its own tail.
-
Game Over: The game ends if the snake hits the wall or its own tail.
main.py
: The main script to run the game.food.py
: Contains theFood
class, responsible for placing food on the screen.snake.py
: Contains theSnake
class, which manages the snake's movement and growth.scoreboard.py
: Contains theScoreboard
class, which displays the current score.food.gif
,snake.gif
: Graphic assets used in the game.
-
Clone the Repository:
git clone https://github.com/your-username/your-repository.git cd your-repository
-
Install Dependencies:
- Ensure you have Python installed (Python 3.6 or higher recommended).
- Install the Turtle graphics library if not already installed:
pip install PythonTurtle
-
Run the Game:
python main.py
Contributions are welcome! Please fork the repository and use a feature branch. Pull requests are reviewed on a regular basis.
This project is licensed under the MIT License. See the LICENSE
file for more information.
- Turtle Graphics for the graphics library.
- Inspiration from classic Snake games.