Ignoring the 5th Touch in a 4 players Touch game

blamekillyblamekilly Member Posts: 5
edited November -1 in Working with GS (Mac)
Hello everyone !

I'm working on a 4 players Touch game prototype on IPhone, I managed to make the 4 player-objects move independently by detecting the Touch ID/number when they are pressed coping with the fact that player can release their object and re-hold it anytime they want.

But as the Iphone supports 5 Touches at the same time I face the problem of the "parasite Touch" : in fact if someone touches anywhere outside its object things go wrong.

How can I detect the Touch that doesn't touch anything in order to give it a Touch ID to ignore it ?

Comments

  • scribblstudiosscribblstudios Member Posts: 118
    Create an attribute that says, touch count (in game attributes), and change that attribute to touch count +1 every time there's a new touch. Change it to touch count -1 when touch is released.
    Finally, set your rules to only work when touch count ≤ 4. Hope this helps!
    :D
  • SparkyidrSparkyidr Member Posts: 2,033
    you don't need to do that.

    you can access the number of touches

    >>devices/touches/count

    wrap your rules in a rule that says when that is less than 5, do your stuff.
  • scribblstudiosscribblstudios Member Posts: 118
    Oh, silly me!
  • blamekillyblamekilly Member Posts: 5
    Thanks guys but I managed to make it work by creating 5 "parasitTouch" arguments so the security is maximum and even if someone starts messing around throwing his fingers all over the place it should be alright : )
Sign In or Register to comment.