A classic Snake Game built using Python and the Turtle Graphics library. Control the snake, eat food to grow longer, beat your high score, and avoid crashing into the walls or your own tail.
- Classic Snake gameplay
- Smooth movement using keyboard controls
- Randomly spawning food
- Score tracking
- High score saved locally
- Automatic game reset after collision
- Clean object-oriented Python code
Snake-Game/
│── main.py # Main game loop
│── snake.py # Snake class and movement logic
│── food.py # Food generation
│── scoreboard.py # Score and high score management
│── data.txt # Stores the highest score
└── README.md
- Python 3
- Turtle Graphics
- Object-Oriented Programming (OOP)
- Clone the repository:
git clone https://github.com/your-username/snake-game.git- Navigate to the project folder:
cd snake-game- Run the game:
python main.pyMake sure Python 3 is installed. The Turtle module comes pre-installed with Python.
| Key | Action |
|---|---|
| ↑ | Move Up |
| ↓ | Move Down |
| ← | Move Left |
| → | Move Right |
- Eat the white food to increase your score.
- Every food collected makes the snake grow longer.
- Hitting the wall or your own tail resets the game.
- Your highest score is automatically saved in
data.txt.
Screenshots of the game.
- Classes and Objects
- Inheritance
- Event Handling
- Collision Detection
- File Handling
- Game Loop
- Turtle Graphics
- Sound effects
- Pause and Resume feature
- Difficulty levels
- Obstacles
- Start Menu
- Better graphics and animations
Contributions are welcome! Feel free to fork this repository, improve the game, and submit a pull request.
This project is licensed under the MIT License.

