How do I ignore a tap action when swiping?

0 favourites
  • 5 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • 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.

  • 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.

  • 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)..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I used 'on tap', but it seems slower than 'is touching' or 'on touched'. Thanks a lot for the help, lads.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)