Hand-Gesture Controlled Snake Game
Interactive Game using Computer Vision (OpenCV + MediaPipe + Pygame)

Project Overview
This project develops an interactive version of the classic Snake game, controlled entirely through hand gestures detected via a webcam. Leveraging OpenCV for video processing and MediaPipe for robust hand tracking, players can guide the snake by simply moving their index finger. The game interface, including the snake, food, and score, is overlaid directly onto the live camera feed using Pygame, creating an engaging augmented reality (AR) like experience.
I built this application from scratch, focusing on integrating real-time computer vision with game logic. The core challenge involved accurately detecting hand landmarks, translating finger movements into snake commands, and seamlessly rendering game elements on top of the dynamic video stream. This project demonstrates practical application of computer vision for intuitive user interaction.
Key Features:
- β Hand-Gesture Control: Navigate the snake using the tip of your index finger detected by the webcam.
- π₯ Real-time Camera Overlay: The game is rendered directly on top of your live camera feed, appearing as a single, unified window.
- π Classic Snake Gameplay: Grow the snake by eating food, avoid self-collision, and navigate wrapping-around boundaries.
- β¨ Dynamic Snake Coloring: The snake's color changes progressively as you gain score.
- π Emoji Food: Food items are represented by engaging emojis for a modern twist.
- π Score Tracking: Keep track of your high score during gameplay.
- βΈοΈ Pause Functionality: Press 'P' to pause and unpause the game.
- π Restart Option: Easily restart the game after a 'Game Over' by pressing 'R'.
- π Optimized Performance: Utilizes MediaPipe's efficient hand detection for smooth real-time performance.
Technologies Used:
Python, OpenCV, MediaPipe, Pygame, NumPy