A nostalgic recreation of the iconic Snake game built with Python and Turtle graphics. Relive the retro gaming experience with smooth controls, custom graphics, and an addictive gameplay loop!
- Classic Gameplay: Navigate the snake using arrow keys to collect food and grow longer
- Custom Graphics: Retro-styled snake head and vibrant background for an authentic experience
- Score Tracking: Keep track of your current score as you play
- Collision Detection: Game ends when the snake hits the wall or its own body
- Smooth Controls: Responsive keyboard input for seamless gameplay
- Python 3.x installed on your system
- No additional libraries required (uses built-in
turtlemodule)
- Clone the repository:
git clone https://github.com/karansingh-in/Classic-Snake-Game.git
cd Classic-Snake-Game- Run the game:
python main.pyThat's it! The game will launch immediately.
- Start the game by running
main.py - Control the snake using WASD or arrow keys:
- W or โฌ๏ธ Up Arrow - Move up
- S or โฌ๏ธ Down Arrow - Move down
- A or โฌ ๏ธ Left Arrow - Move left
- D or โก๏ธ Right Arrow - Move right
- Eat the food (red circles) to grow longer and increase your score
- Avoid hitting:
- The walls (screen boundaries)
- Your own snake body
- Try to beat your high score!
Classic-Snake-Game/
โ
โโโ main.py # Main game loop and setup
โโโ snake.py # Snake class with movement logic
โโโ food.py # Food class for spawning items
โโโ background.gif # Game background image
โโโ snake-head.gif # Custom snake head sprite
โโโ icon.ico # Game window icon
Want to create a standalone executable? Use PyInstaller!
pip install pyinstaller
pyinstaller main.specSee the platform-specific .spec files in the repository.
Contributions are welcome! Here are some ideas:
- Add difficulty levels (speed variations)
- Implement a high score system with persistent storage
- Add sound effects and background music
- Create power-ups (speed boost, invincibility, etc.)
- Add a pause function
- Implement a menu system
To contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the original Snake game from Nokia phones
- Built with Python's Turtle graphics module
- Thanks to the Python community for excellent documentation
Karan Singh - @karansingh-in
Project Link: https://github.com/karansingh-in/Classic-Snake-Game
โญ Star this repo if you enjoyed the game!
