Hi,
I’m making a prototype that you swipe and according to the direction and length of the swipe, it would throw some stuff, like how you do with Angry Birds but in that game you draw a sling and it will shoot in the direction of the sling being pulled back but in this game image the opposit and if you touch and swipe on a direction, it would shoot something.
I managed to get it working for most angles but it’s not OK yet, here’s what I’ve done so far:
foodObject:applyLinearImpulse( event.x - event.xStart, event.y - event.yStart, foodObject.x, foodObject.y )
but it has two problems:
-
it doesn’t work for downward angles
-
It doesnt take account of the lenght of the swipe.
Thanks.