How do I to detect the direction of touch?

Get help using Construct 2

Post » Wed Oct 12, 2016 1:41 pm

Hi everybody !

Construct 2 is very powerful and useful tool !!!
But I do not know if it is possible to detect the direction in which our finger goes when you touch a sprite.

[SPRITE] = (finger goes to LEFT ---> RIGHT or RIGHT ---> LEFT)

Thank you for your help !
B
4
S
1
Posts: 18
Reputation: 388

Post » Wed Oct 12, 2016 3:02 pm

Click the "tutorials" tab above and search "touch". I was going to post some links to the threads but there are just so many good ones for you to read through and answer your question.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Wed Oct 12, 2016 5:58 pm

Thank you for your answer but i don't find a solution.

Look my capx example : https://mon-partage.fr/f/aoUvHiVH/
B
4
S
1
Posts: 18
Reputation: 388

Post » Thu Oct 13, 2016 1:38 pm

https://dl.dropboxusercontent.com/u/26406130/Prototype.capx

Look at this .capx in the left and right swipe events. It's not a cut-paste solution to your problem but it shows you how to detect a right/left swipe and act on it.
In your example it sounds like your more interested in grabbing the direction than acting on it at this point... this is as simple as comparing the variables isLeft and isRight in the capx example (they are instance variables in the penqwin sprite but you could make globals). If isLeft = 1 and isRight = 0 player swiped L, etc.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Thu Oct 13, 2016 1:58 pm

Thank you very much for your example ! This will help me a lot.
B
4
S
1
Posts: 18
Reputation: 388


Return to How do I....?

Who is online

Users browsing this forum: NN81 and 3 guests