A simple Snake Game built using Python and Tkinter.
The game uses a grid-based movement system, score tracking, and smooth animation using Tkinter’s after() loop.
- Classic snake movement
- Arrow-key controls
- Food spawns at random grid positions
- Snake grows when food is eaten
- Score display
- Wall and self-collision detection
- Game Over screen
- Clean Tkinter GUI with centered window
- Python 3.x
- Tkinter (built-in GUI library)
- Random module
-
Clone the repository:
git clone https://github.com/Yusra-Azeem/python-project
-
Navigate to the project folder:
cd python-project -
Run the game:
python snake.py
| Key | Action |
|---|---|
| ⬅️ Left Arrow | Move Left |
| ➡️ Right Arrow | Move Right |
| ⬆️ Up Arrow | Move Up |
| ⬇️ Down Arrow | Move Down |
snake.py # Main game file
This project is open-source and free to use.