Skip to content

stevenbuccini/Leap-Motion-RockPaperScissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Leap Motion RockPaperScissors

Play Rock Paper Scissors against the computer with your Leap Motion!

This project was built at a Leap Motion-sponsored hackathon at my school. This means that the code is still very buggy, and I no longer have a Leap Motion to test it.

The code tracks two things primarily:

  1. Position of your hands - When you play Rock, Paper, Scissors in real life, you pump your first as you say "Rock, Paper, Scissors!" We track the pumping motion as well by watching the changing velocity of your palm. On the third downward stroke, we look for what sign you threw (see below).
  2. Number of fingers - The Leap Motion can only detect your fingers if they are moderately extended and positioned directly over the device.
  • If we see no fingers, we assume your hand is in a fist and figure you are showing Rock.
  • If we see 1-2 fingers, we assume you're throwing scissors.
  • If we see =< 3 fingers, we assume you're throwing paper.

Usage

  1. Download the Leap Motion SDK, then run gamelogic from the command line with the following command:

python3 -i gamelogic.py

  1. Show the device how many players you want to play by extending a finger. Only single player is supported right now, although the Leap Motion can track two hands at once, so theoretically multiplayer can happen.
  2. Pump your hands up and down as you count off "Rock, Paper, Scissors!"
  3. Flash your sign over the Leap Motion.

About

Play Rock Paper Scissors against the computer with your Leap Motion!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages