Rock, Paper, Kinect for Windows v2...
Today we continue to follow Bruno Capuano on his Kinect for Windows v2 journey, this time as he shows off more of the new capabilities coming...
Christmas is over and also New Year festivities, I also have some party with my renewal as MVP for the 7th time, so I’ll go back and start again with some posts about Kinect for Windows V2. For this post I’ll make a game “Rock Paper and scissors” with the new Kinect for Windows V2.
Note: if you don’t know how to play Rock, paper or scissors, Wikipedia explains it to you here .
The truth is that implementing this game is quite simple with Kinect for Windows V2, since now the HandState property supports several States
The first 3 allow us to have a match with the States of the game
- Open, paper
- Closed, rock
- Lasso, scissors
In this way, the only thing we have to do is to validate hand States with a Random computer-generated (by the way, the routine that generates the Random of an Enum have taken it from StackOverflow is a Marvel).
The main view of the app has a button that pressed down, start a timer with a downward counter for 5 seconds.Every tick of the timer displays the status of the hand of the player (line 24), and when the counter reaches zero, it generates a random game (line 41) value and validated the possibilities to define a winner (lines 48 to 80).
Project Information URL: http://elbruno.com/2014/01/04/kinectone-rock-paper-scissors-with-kinectforwindowsv2/
This conversation has been locked by the site admins. No new comments can be made.