4 direction swipe?
![HasifUzir](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
So, I've followed tshirtbooth's tutorial on swiping and I've got myself 4 attributes TouchX, TouchY, ReleaseX, ReleaseY.
I made an actor to tell me the output of my swipe whether it's up down left or right. Swiping left & right (up & down off) works fine and same goes for swiping up & down(left & right off). But when all 4 rules are on at the same time, it looks like they interfere with one another and my output actor displays the wrong direction most of the time.
What's the best way to implement 4 way swiping controls?
I made an actor to tell me the output of my swipe whether it's up down left or right. Swiping left & right (up & down off) works fine and same goes for swiping up & down(left & right off). But when all 4 rules are on at the same time, it looks like they interfere with one another and my output actor displays the wrong direction most of the time.
What's the best way to implement 4 way swiping controls?
Comments
What I've done is I've made 2 extra attributes. game.DistanceX and game.DistanceY and each "distance" is calculated with: abs(releaseX-touchX) for DistanceX and just change it to Y for DistanceY.
For example, swipe right. For the rule, in addition to "if ReleaseX > TouchX", I've added "if DistanceX > DistanceY".
Now, swiping in the 4 directions works and if I swipe diagonally, the direction will depend on DistanceX and DistanceY.
Thanks,