Skip to content

CodeWithBasu/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game Using Python with OpenCV Hand Direction

This is an interactive Snake Game built using Python, OpenCV, and cvzone. The game utilizes hand gestures for controlling the snake's movement in real-time using computer vision.

Features

  • Hand Gesture Control: Control the snake using your hand's direction.
  • Real-Time Processing: Smooth and responsive gameplay.
  • Score Tracking: Collect food to increase your score.
  • Collision Detection: The game ends upon collision with the wall or itself.
  • Simple Interface: Enjoy a clean, user-friendly gaming experience.

Technologies Used

  • Python for game logic
  • OpenCV for real-time video processing
  • cvzone for simplified hand detection
  • NumPy for calculations
  • PIL (Pillow) for image rendering

Installation

  1. Clone the repository:
    git clone https://github.com/CodeWithBasu/SnakeGame.git
  2. Install required packages:
    pip install opencv-python cvzone numpy Pillow
  3. Run the game:
    python snake_game.py

How to Play

  • Use hand gestures to control the snake.
  • Move your hand up, down, left, or right to navigate.
  • Eat the food to increase your score.
  • Avoid colliding with the walls or yourself.

Troubleshooting

  • Ensure the webcam is working.
  • Install any missing dependencies using pip install.
  • Adjust lighting for better hand detection.

Contributing

Contributions are welcome! Fork the repository and submit a pull request.

Enjoy playing the Snake Game with your hands and experience a unique way of gaming using computer vision!

About

🐍🎮The Snake Game using Python with OpenCV hand direction is an interactive project using hand gestures to control a snake. Developed with Python, OpenCV, and cvzone, it detects hand movements for real-time control. Featuring score tracking, collision detection, and a simple interface, it offers a fun and innovative gaming experience.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages