This project is a hand-controlled Snake Game implemented using OpenCV and Python. It allows you to play the classic Snake Game by moving your hand in front of a webcam, making it a fun and interactive experience. The snake follows your hand gestures as you navigate it to collect food items and increase your score.
- Hand tracking using OpenCV
- Real-time snake movement control
- Score tracking and game over conditions
- Responsive food item placement
- Easy-to-use and interactive gameplay
Watch a short demo of the game in action here.
To run the game, you'll need the following libraries and tools:
- Python 3.x
- OpenCV
- NumPy
- cvzone
- A webcam
-
Clone the repository:
git clone https://github.com/your-username/snake-game.git cd snake-game
-
Install the required libraries:
pip install opencv-python numpy cvzone
-
Run the game:
python snake_game.py
-
Follow the on-screen instructions to control the snake with your hand.
The game uses OpenCV for hand tracking, detecting landmarks on your hand, and calculating the snake's movement based on your hand's position. When the snake eats food, your score increases. If the snake collides with its own body, the game ends.
This project is licensed under the MIT License. See the LICENSE file for details.
- cvzone - A computer vision library that simplifies working with OpenCV.
- OpenCV - An open-source computer vision library.
Feel free to contribute to this project or reach out for questions and collaborations.
Enjoy playing the Hand-Controlled Snake Game!