How do I ignore a tap action when swiping?

Get help using Construct 2

Post » Mon Jan 04, 2016 7:43 pm

Hey. Got my controls set up like this: Left side of screen to shoot fireball, right side to jump, swipe to slide. But if I swipe, it shoots or jumps depending on where I swipe. Is there a way to ignore a touch action if I'm swiping? So I don;t accidentally do those other 2 moves?

Thanks for the help.
B
7
S
2
Posts: 60
Reputation: 604

Post » Mon Jan 04, 2016 8:58 pm

save touch X,Y to a var on touch start, and check distance from current touch X,Y on touch end, if it's greater than X (try different offsets) then it's a swipe, else it's a click.

You might also want to add a timer that counts while touching, so if you release the touch after a long time, maybe it's better to consider it a click and not a swipe.
Image
B
67
S
26
G
12
Posts: 510
Reputation: 11,972

Post » Mon Jan 04, 2016 11:03 pm

Gypopothomas wrote:Hey. Got my controls set up like this: Left side of screen to shoot fireball, right side to jump, swipe to slide. But if I swipe, it shoots or jumps depending on where I swipe. Is there a way to ignore a touch action if I'm swiping? So I don;t accidentally do those other 2 moves?

Thanks for the help.


Are you using "on tap" ?
(because that shouldn't trigger on a longer touch)..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jan 04, 2016 11:08 pm

I used 'on tap', but it seems slower than 'is touching' or 'on touched'. Thanks a lot for the help, lads.
B
7
S
2
Posts: 60
Reputation: 604

Post » Mon Jan 04, 2016 11:22 pm

Tap triggers on end of touch and if touch time is greater than some value, you're probably looking to trigger it when touch starts and not end.
Image
B
67
S
26
G
12
Posts: 510
Reputation: 11,972


Return to How do I....?

Who is online

Users browsing this forum: alextro, christina, Kyatric, omnipaws and 9 guests