Swipe direction selects animations

Get help using Construct 2

Post » Tue Nov 27, 2012 10:17 pm

Hello,

I'm creating a game intended for mobile. I need the character to follow the direction of the players finger when swiping left or right. I want the animation to change from the default to a different animation when swiping left and to yet another animation if the player is swiping right.

Any tips?

As always, thanks in advance.
B
8
S
1
Posts: 38
Reputation: 1,183

Post » Tue Nov 27, 2012 10:49 pm

Maybe take down the X coordinate as variable "StartTouchX" of the touch on the touch trigger, then have a second variable as "EndTouchX" and update that every tick until a "touch end" is triggered?
B
56
S
20
G
7
Posts: 305
Reputation: 8,754

Post » Tue Nov 27, 2012 11:14 pm

Thanks for the reply.

But how would I then tell it to select a specific animation while it's updating? Would I have 4 variables - startTouchXLeft/endTouchXLeft and startTouchXRight/endTouchXRight?
B
8
S
1
Posts: 38
Reputation: 1,183


Return to How do I....?

Who is online

Users browsing this forum: Rezzon71, tarek2 and 22 guests