After that I created a sub patcher that holds the information of the range like x and y as well as z which is depth. For y patcher I used primarily the Z range because that detect how close a fist is to the Kinect. After I was able to set a range that sends a bang every time a fist goes beyond 0.2 of range.
To mimic a fighting game, I set a beginning time that does not allow the player or computer to hit until after 5 second. another way to mimic a game, I was able to create a life bar that decreases every time the Kinect detects a punch. After I was able to establish how the life bar would deplete (by subtracting 10 from from the life bar when a fist is in range) I wanted to create a blocking system so that it would even further be like a game. To do this I again used the Z depth but this time to detect how further is the leg. My blocking system is detected by putting your right leg back. I saw that wen people were playing this they were blocking ad punching at the same time and I believed that that was not fair so I used a ggate object to switch from blocking to hitting so if someone tries to punch while hitting it would not be possible to do damage. After I established everything that needed to be done for the user I started on the computer.
The computer was a lot less complicated in terms of creating punches and blocks. The computers runs of a metro which is basically a digital metronome which means that it could determine how fast bangs are given out. These bangs would be sent into a random number generator that is set to 50 so that it outputs 50 random numbers from the range of 0 to 49. In order to send out a punch I used what is called the select object which is an object that only sends out a bang when the random number generator (or whatever its connected to) reaches a specific number. I did this for both punches and blocks and like the user if the computer blocks it cannot hit you.
Once I had the fight system going, I created visuals so that the patch isn't plain. These visuals consisted of street fighter gifs that were turned into mov's (so that Max could read it). Each action had a corresponding video. For instance, a right punch would trigger a right punch video and so on. A problem with this is that I had to use a Rate atter UI to make the video play faster the reason that I did this is because people would punch so fast that the action on the video would not play all the way through. same thing goes for the computer which is still something I was not able to fix.
Something that i wanted to do with this patch was make it realistic and to do that I wanted the video to go back to a regular stance when either the computer or the player or doing nothing. which means that after a punch or a block the video would go back to its a original stance. To do this the toggle button was used. the toggle button has to numbers in it 0 (off) and 1 (on) using these 2 numbers I switched between an action and a stance pretty easily.After all the videos were fixed I recreated an end game that would not only stop the game but also play an end game mov. since the life bar has numbers for a range I used a select object for when the slider reaches 0. when the slider reaches 0 the patch stops by closing (setting to 0) all ggates and toggles but playing a video on both sides that is triggered only when the slider reaches 0. along with this a message with a 1 in it is sent to the Rate atter UI so that the end game is played at normal speed.

