A classic Snake game built from scratch in Python with pygame — no external game engine, just core programming logic: game loops, collision detection, and state management.
Wanted hands-on practice with real-time game loops, keyboard input handling, and collision detection — the fundamentals behind most 2D games.
- Smooth grid-based movement with keyboard controls
- Progressive difficulty — speed increases as your score grows
- Pause / resume with
P - Game-over detection (wall and self collision) with instant restart via
R - Clean, minimal visual style
snake-game/
├── snake_game.py # the full game
├── requirements.txt
└── README.md
python3 -m venv venv
source venv/bin/activate # on Windows: venv\Scripts\activate
pip install -r requirements.txtpython snake_game.pyControls
| Key | Action |
|---|---|
| Arrow keys | Move |
| P | Pause / resume |
| R | Restart (after game over) |
| Esc | Quit |
Python, pygame
Rushikesh Pimple — LinkedIn