Giter Site home page Giter Site logo

snake_game's Introduction

Hand-Controlled Snake Game with OpenCV and Python

Snake Game Demo

Overview

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.

Features

  • 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

Demo

Watch a short demo of the game in action here.

Requirements

To run the game, you'll need the following libraries and tools:

  • Python 3.x
  • OpenCV
  • NumPy
  • cvzone
  • A webcam

Getting Started

  1. Clone the repository:

    git clone https://github.com/your-username/snake-game.git
    cd snake-game
  2. Install the required libraries:

    pip install opencv-python numpy cvzone
  3. Run the game:

    python snake_game.py
  4. Follow the on-screen instructions to control the snake with your hand.

How it Works

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • cvzone - A computer vision library that simplifies working with OpenCV.
  • OpenCV - An open-source computer vision library.

Author

Feel free to contribute to this project or reach out for questions and collaborations.

Enjoy playing the Hand-Controlled Snake Game!

Snake Game

snake_game's People

Contributors

1abhi6 avatar

Stargazers

TANUL YADAV avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.