Skip to content

About

Classic Snake game built with Python, Pygame & OpenGL for real-time graphics rendering.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🐍 Snake Game (OpenGL)

A classic Snake game built with Python, Pygame, and OpenGL — rendered using real-time 3D graphics pipeline instead of standard 2D sprites.


🎮 Gameplay

  • 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

✨ Features

  • 🎮 Classic snake mechanics
  • 🖥️ Rendered using OpenGL (PyOpenGL) — not basic 2D pygame
  • 🔴 Randomly spawning food that avoids snake body
  • 💚 Smooth grid-based movement
  • 📊 Score tracking

🎮 Controls

Key Action
⬆️ Up Arrow Move Up
⬇️ Down Arrow Move Down
⬅️ Left Arrow Move Left
➡️ Right Arrow Move Right

🛠️ Tech Stack

  • Python 3.x
  • Pygame
  • PyOpenGL
  • OpenGL / GLU

⚙️ Setup & Run

# 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.py

📁 Project Structure

snake-game-opengl/
├── snake.py      # Main game file
└── README.md

🧠 Why OpenGL?

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.

About

Classic Snake game built with Python, Pygame & OpenGL for real-time graphics rendering.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages