Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.71 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.71 KB

Rock Paper Scissors Game with Hand Tracking using OpenCV

Welcome to the Rock🪨 Paper📄 Scissors✂️ game with hand tracking! This simple yet interactive game allows you to play Rock Paper Scissors against an AI opponent using hand gestures.

Requirements

  • Python 3.x
  • OpenCV
  • cvzone
  • Mediapipe for Hand Detection

IDE used

Pycharm by JetBrains (recommended)

You need to import cvzone and mediapipe library at your machine in this directory

How to Play

  1. Run the script.
  2. Press 's' to start the game.
  3. Use your hand gestures to make a move (rock, paper, or scissors).
    • Rock: Fist with all fingers closed.
    • Paper: Open hand with all fingers extended.
    • Scissors: Fist with index and middle fingers extended.
  4. The AI will also make a random move.
  5. The winner of each round will be displayed based on Rock Paper Scissors rules.
  6. Press 'b' to exit the game at any time.

Game Controls

  • Press 's' to start a new game.
  • Press 'b' to exit the game and view the final score.

Notes

  • The game features a timer for each round, allowing fair gameplay.
  • Hand tracking is performed using the Mediapipe library.
  • The cvzone library is used for overlaying images on the game background.
  • The AI's moves are randomly generated.
  • Scores are displayed on the screen, showing both the AI and player scores.

Demo

rock.paper.scissor.mp4

Feel free to explore, modify, and enhance the game as you like! Enjoy playing Rock Paper Scissors with a twist of hand tracking. If you encounter any issues or have suggestions for improvement, please let me know.

Stone✊ Paper🖐️ Scissor✌️ !

Have fun gaming! 🎮