A classic Snake Game developed using Python and the Turtle graphics library.
- Continuous snake movement
- Keyboard controls
- Random food spawning
- Score tracking
- Snake growth after eating food
- Wall collision detection
- Self-collision detection
- Game Over screen
- Python
- Turtle Graphics
- Object-Oriented Programming (OOP)
main.py - Main game loop and collision detection
snake.py - Snake class and movement logic
food.py - Food generation and random spawning
scoreboard.py - Score tracking and game over display
- Clone the repository
git clone
- Navigate into project folder
cd python-snake-game
- Run
python main.py
This project helped me practice:
- Object-Oriented Programming
- Class Design
- Event Handling
- Collision Detection
- Game Loops
- Python Turtle Graphics
Potential features that could be added in future versions of the game:
-
High Score System
- Save and display the highest score achieved across game sessions.
-
Difficulty Levels
- Allow players to choose Easy, Medium, or Hard modes with different snake speeds.
-
Pause and Resume Functionality
- Enable players to pause and continue the game using a keyboard shortcut.
-
Sound Effects
- Add audio feedback for eating food and game-over events.
-
Improved Graphics
- Replace default Turtle shapes with custom sprites and backgrounds.
-
Obstacles
- Introduce walls or obstacles that the snake must avoid.
-
Restart Option
- Allow players to restart the game without closing the application.
-
Power-Ups
- Add special food items that provide bonus points or temporary abilities.
-
Multiplayer Mode
- Support two-player gameplay using different keyboard controls.
-
Scoreboard Enhancements
- Display current score, high score, and game statistics.
Netri Patel Bachelor of Information Technology Major in Networks & Cyber Security Griffith University