A classic Snake game built with Python Turtle graphics, featuring real-time movement, food generation, collision detection, and persistent high-score tracking.
- 🎮 Smooth keyboard controls (Arrow Keys)
- 🍎 Random food spawning
- 📈 Score & high-score system (persistent storage)
- 💥 Collision detection:
- Wall boundaries
- Snake tail
- 🔄 Automatic reset after game over
- 🎨 Minimalistic UI with Turtle graphics
Controls: ⬆️ Up Arrow → Move Up ⬇️ Down Arrow → Move Down ⬅️ Left Arrow → Move Left ➡️ Right Arrow → Move Right
├── main.py # Game entry point
├── snake.py # Snake logic & movement
├── food.py # Food generation logic
├── scoreboard.py # Score tracking system
├── data.txt # High score storage
├── README.md # Documentation
└── .gitignore # Ignored files list
🎯 How It Works
Game Logic Overview
The snake moves continuously forward
Player changes direction using arrow keys
Eating food:
Increases length
Increases score
Collision causes:
Score reset
Snake reset
High-score saved
🧠 Key Concepts Used
Object-Oriented Programming (OOP)
Event listeners (screen.onkey)
Game loop (while)
Collision detection
File I/O for persistent data
Turtle animation optimization (screen.tracer(0))