A classic Snake game implementation built with Python's Turtle graphics library. Control a pink snake as it grows by eating blue food pellets while avoiding walls and your own tail.
- Smooth Controls: Intuitive arrow key navigation
- Real-time Scoring: Live score display that updates with each food eaten
- Collision Detection: Game ends when hitting walls or your own tail
- Dynamic Food Spawning: Food appears randomly across the game area
- Clean Graphics: Black background with colorful snake and food elements
- Object-Oriented Design: Modular code structure for easy maintenance
- Objective: Control the snake to eat as much food as possible
- Movement: Use arrow keys to change direction
- Growth: Snake grows longer with each food eaten
- Scoring: Score increases by 1 for each food consumed
- Game Over: Occurs when snake hits walls or its own tail
- Restart: Click anywhere to close the game window
- Python 3.7 or higher
- No additional packages required (uses built-in Turtle library)
-
Clone the repository:
https://github.com/Algos-bySchizo/Snake-Xenzia-.git cd snake-xenzia -
Run the game:
python main.py
- Start the Game: Execute
python main.pyin your terminal - Controls:
- ⬆️ Up Arrow: Move snake upward
- ⬇️ Down Arrow: Move snake downward
- ⬅️ Left Arrow: Move snake left
- ➡️ Right Arrow: Move snake right
- Gameplay: Guide the snake to eat blue food pellets
- Exit: Click anywhere on the game window to close
snake-xenzia/
├── main.py # Main game loop and initialization
├── snake.py # Snake class with movement and growth logic
├── food.py # Food class for spawning and positioning
├── scoreboard.py # Score tracking and display
└── README.md # Project documentation
main.py: Contains the main game loop, screen setup, and collision detectionsnake.py: Defines the Snake class with movement methods and segment managementfood.py: Handles food creation, positioning, and random spawningscoreboard.py: Manages score display and game over messages
- Python 3.x: Core programming language
- Turtle Graphics: Built-in Python graphics library for game rendering
- Object-Oriented Programming: Modular class-based architecture
- Random Module: For food positioning
- Time Module: For game loop timing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Add different difficulty levels
- Implement high score tracking
- Add sound effects
- Create different food types with varying points
- Add power-ups or obstacles
- Implement a pause feature
- Add different snake colors or themes
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the classic Snake game
- Built as a learning project for Python game development
- Uses Python's built-in Turtle graphics library
- Project Link: [https://github.com/Algos-bySchizo/snake-xenzia]
⭐ Star this repository if you found it helpful!