A simple and addictive Snake Game developed in Python using the Pygame library. ๐น๏ธ
Navigate the green snake, eat the red food blocks, and grow longer with every bite! Avoid crashing into the walls or yourself โ or itโs game over.
This project demonstrates the use of:
- Keyboard input handling
- Dynamic object rendering
- Collision detection
- Game loop mechanics
- Score tracking
| Component | Used |
|---|---|
| Language | Python 3.x |
| Library | Pygame |
| Interface | Pygame Window |
Before running the game, make sure to install dependencies:
pip install pygamepython snake_game.py(Replace snake_game.py with your actual filename)
| Key | Action |
|---|---|
| โฌ ๏ธ Left | Move Left |
| โก๏ธ Right | Move Right |
| โฌ๏ธ Up | Move Up |
| โฌ๏ธ Down | Move Down |
| Q | Quit on Game Over |
| C | Restart Game |
- Real-time score display
- Auto-growing snake
- Randomized food spawning
- Game over and replay functionality
- Game loop using
whilewith event handling - Snake represented by a dynamic list of coordinates
- Collision detection against wall and self
- Score shown with custom fonts
- Restart logic using recursion
๐ค Usama Shaikh ๐ง Email: shaikhusama541@gmail.com ๐ GitHub: @fewgets
Feel free to reach out for:
- ๐ Training code
- ๐งช Data processing pipeline
- ๐ค Collaboration
- ๐ฌ Guidance
This project is for academic and research purposes only. Feel free to fork, reference, and learn - but give credit where due ๐