This is a classic Snake game built using Python’s turtle module. The player controls a snake that grows longer as it eats food, while trying to avoid collisions with boundaries and its own body. The game tracks the current score and the high score across plays.
- Smooth snake movement with keyboard control
- Random food spawning
- Snake body grows when food is eaten
- Score and high score tracking
- Collision detection for walls and self
- Simple start and exit controls
- Clean and responsive UI
- Start Game: Press
P - Exit Game: Press
E - Move Snake:
- Up:
W - Down:
S - Left:
A - Right:
D
- Up:
- Python 3.x
turtlegraphics- Standard libraries:
time,random
- Clone the repository:
git clone https://github.com/codebyimran-projects/Snake-game-python.git- Navigate to the project folder:
cd Snake-game-python- Run the game:
python main.pyThe objective of the game is to eat as many pieces of food as possible without hitting the walls of the game window or the snake’s own body. The snake gets longer with each piece of food eaten, increasing the difficulty.
Made by: codebyimran
Repository:
https://github.com/codebyimran-projects/Snake-game-python