A classic Snake game built with Python, Pygame, and OpenGL — rendered using real-time 3D graphics pipeline instead of standard 2D sprites.
- Control the snake using arrow keys
- Eat red food to grow longer and earn points (+10 per food)
- Game ends if the snake hits a wall or itself
- Final score displayed in terminal on game over
- 🎮 Classic snake mechanics
- 🖥️ Rendered using OpenGL (PyOpenGL) — not basic 2D pygame
- 🔴 Randomly spawning food that avoids snake body
- 💚 Smooth grid-based movement
- 📊 Score tracking
| Key | Action |
|---|---|
| ⬆️ Up Arrow | Move Up |
| ⬇️ Down Arrow | Move Down |
| ⬅️ Left Arrow | Move Left |
| ➡️ Right Arrow | Move Right |
- Python 3.x
- Pygame
- PyOpenGL
- OpenGL / GLU
# Clone the repo
git clone https://github.com/yourusername/snake-game-opengl.git
cd snake-game-opengl
# Install dependencies
pip install pygame PyOpenGL PyOpenGL_accelerate
# Run the game
python snake.pysnake-game-opengl/
├── snake.py # Main game file
└── README.md
Most Snake games use basic Pygame 2D drawing. This project uses OpenGL's rendering pipeline (quads, vertex coordinates, orthographic projection) — showing understanding of graphics programming beyond standard libraries.