https://github.com/harishrajt/snake_game
A classic Snake game where players control a snake that grows longer by eating food while avoiding collisions with walls and itself. Built using Python's turtle graphics library, the game features a scoring system that tracks the player's score and high score, with the ability to reset upon game over.
https://github.com/harishrajt/snake_game
filehandling turtle-graphics
Last synced: 4 months ago
JSON representation
A classic Snake game where players control a snake that grows longer by eating food while avoiding collisions with walls and itself. Built using Python's turtle graphics library, the game features a scoring system that tracks the player's score and high score, with the ability to reset upon game over.
- Host: GitHub
- URL: https://github.com/harishrajt/snake_game
- Owner: harishrajT
- Created: 2024-10-12T10:51:54.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-10-15T16:02:41.000Z (9 months ago)
- Last Synced: 2025-01-07T21:16:43.357Z (6 months ago)
- Topics: filehandling, turtle-graphics
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snake Game
A classic Snake game built using Python's Turtle graphics library. The objective of the game is to control the snake to eat food, grow in length, and avoid colliding with the walls or itself.
## Features
- **Snake Movement:**
- Use the arrow keys to control the snake's direction (Up, Down, Left, Right).
- **Food Generation:**
- The snake can eat food to grow longer.
- The food is randomly placed on the screen.- **Scoring System:**
- The score increases by one for every food item eaten.
- The high score is saved in a file.- **Collision Detection:**
- The game ends when the snake collides with the wall or itself.
- **Reset Functionality:**
- The snake and score reset upon collision.## Requirements
- Python 3.x
- Turtle graphics library (pre-installed with Python)## How to Run
1. **Clone the repository** or download the code files.
2. Run the `snake_game.py` script using Python:
```bash
python snake_game.py