A classic Snake game implementation in Python using Pygame.
- Classic Snake gameplay
- Score tracking
- Smooth movement and controls
- Grass-pattern background
- Collision detection (walls and self)
- Food spawning system
- Python 3.6 or higher
- Pygame 2.5.2
-
Navigate to the snake_game directory:
cd snake_game -
Install the required dependencies:
pip install -r requirements.txt
Double-click on run_game.bat or run it from the command line:
run_game.bat
Run the game using Python:
python snake_game.py
Note: Make sure pygame is installed first:
pip install pygame
- Arrow Keys: Control the snake's direction
- ↑ Up Arrow: Move up
- ↓ Down Arrow: Move down
- ← Left Arrow: Move left
- → Right Arrow: Move right
- Control the green snake to eat the red food
- Each food eaten increases your score by 1
- The snake grows longer with each food consumed
- Avoid hitting the walls or the snake's own body
- The game ends when the snake collides with a wall or itself
- Snake: Dark green blocks that make up the snake's body
- Food: Red blocks that appear randomly on the screen
- Score: Displayed at the top center of the screen
- Background: Green with a grass pattern
Enjoy playing the Snake game!