
Back in 2010,
Kinect from Microsoft was born. But, fortunately or not, the news about the miracle sensor did not “hook” me. I remembered, or rather, reminded me of him a year later, when I had the idea of acquiring, as it turned out, a stylish collection dust - Xbox 360 Slim. Although the console is turned on only during drunken parties, positive emotions and funny videos leave behind quite a few. But having played enough in the standard
Adventures and
Joy Ride , the idea of creating your own game for Kinect got into the head, as it turned out, everything is quite simple ...
Idea
')
Without pretending to the laurels of
Rovio ,
Halfbrick and the like, it was decided to create a simple (as they also thought for a narrow circle of friends) game. The idea of the game was born by itself, after the word “simple” was voiced, portable electronic games - “Electronics” were immediately recalled. Yes Yes…. Those same PSP - 80s.
As well as possible, under our ideas, the most popular game from the series came up - “Well, wait a minute!”. Having decided on the game and bought beer, the work began.

Implementation
From soft used:
- Visual Studio C # 2010
- Microsoft XNA 4.0
- Kinect SDK (at the beginning it was a beta, later it was upgraded to version 1.5)
- Coreldraw
Solid and liquid:
In the first version of the game, the original graphics of the classic “Well, wait, wait!” Was taken as a basis, the control was carried out from the keyboard. This was enough to test and configure all components. Making sure that everything works, work began on the interaction of the game with Kinect.
So, as the wolf has only four positions, hence the player also has four of them. Management was decided to make the most natural and understandable, that is, for catching eggs, the player must repeat the movements of the wolf in the game.

To determine the position occupied by the player, it took us only 6 points monitored by the sensor:

rh = skeleton.Joints[JointID.HandRight]; lh = skeleton.Joints[JointID.HandLeft]; rs = skeleton.Joints[JointID.ShoulderRight]; ls = skeleton.Joints[JointID.ShoulderLeft]; rk = skeleton.Joints[JointID.KneeRight]; lk = skeleton.Joints[JointID.KneeLeft];
- rh - right hand / hand
- lh - left hand / hand
- rs - right shoulder
- ls - left shoulder
- rk - right knee
- lk - left knee
Actually implementation:
if (rh.Position.Y > rs.Position.Y && (rh.Position.Y - lh.Position.Y) <= 0.1 && (rh.Position.X - lh.Position.X) <= 0.1 && (rh.Position.X - rs.Position.X) >= 0.3) { state = 1; } else if (lh.Position.Y > ls.Position.Y && (rh.Position.Y - lh.Position.Y) <= 0.1 && (rh.Position.X - lh.Position.X) <= 0.1 && (lh.Position.X - ls.Position.X) <= -0.3) { state = 0; } else if (lh.Position.Y < lk.Position.Y && (rh.Position.Y - lh.Position.Y) <= 0.1 && (rh.Position.X - lh.Position.X) <= 0.1 && (lh.Position.X - lk.Position.X) <= 0) { state = 2; } else if (rh.Position.Y < rk.Position.Y && (rh.Position.Y - lh.Position.Y) <= 0.1 && (rh.Position.X - lh.Position.X) <= 0.1 && (rh.Position.X - rk.Position.X) >= 0) { state = 3;
The code checks the positions of the joints by comparing them with each other, and decides on the position of the wolf if the player has done the movements correctly. Namely, in order to catch eggs from the upper tiers, you have to raise your hands above your shoulders. And for eggs from the lower tiers, hands should be below, relative to the player's knees.
Completion of the game
Hurray it worked! Having played a couple of days, as often happens, I wanted something more from the toy. Not so much in functional terms as in its interface, it’s too gray, without the year a 30 year old game, it looks on the big screen.
It was decided to repaint it, and not just repaint, but to paint everything anew. But since there were no artists or other “pencils” among us, we had to resort to the help of freelancers.
pencils * - so we affectionately call graphic designers
Here began the most interesting, namely, negotiations with the designer. The freelancer persistently redrawed everything in his style, radically moving away from the sketches I submitted, but as a result I managed to achieve the desired results from him.
That was the main character:

But how it came to the eggs, a question came up that interested me when I was very young. And why should a wolf have eggs ...!? Like a predator, is it not easier for him, instead of catching eggs, to scramble along a trench, and not to take a pair of chickens with him?
But since I didn’t want to fundamentally rewrite the game, I had to think of something that would also have slipped (like the eggs) to a wolf in a bag, but it looked more logical, considering the wolf’s meat / game needs.
And to replace the eggs, they came ...
Yes! As you may have guessed - pigs!
do not look for analogies with the games mentioned above, the pigs came up with themselvesIn the form of a bonus, three levels of difficulty were also added to the game (differing from each other in the initial speed of the piglets rolling) and the table of records. And so the game appeared, with quite a logical name, Hungry Wolf.
A couple of screenshots:



Well, that's all. Thanks to those who read or scrolled to the end, if you have questions about the technical implementation or what others - ask, I will answer.
UPD1 video gameplayUPD2 Updated game for
Windows Phone to version 1.6 +
video