News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • December 13, 2018, 09:11:05 AM

Login with username, password and session length

Author Topic: Easy Swipe  (Read 923 times)

Offline guillemros

  • Newbie
  • *
  • Posts: 2
Easy Swipe
« on: April 20, 2017, 01:06:53 PM »
Hey there, I've looked around on the forums and the documentation but can't find what I'm looking for.

I'm creating an endless runner where you swipe the screen to change lanes and jump obstacles. I'm using EasySwipe and it works fine. However, EasySwipe only performs the action when you release the finger after the swipe is done, which makes the swiping experience a little slow compared to other games. Is there a way to create a swipe gesture that performs an action even though the finger has not been released yet? So for example while I'm swiping left i have swiped more than 100 pixels (or a certain threshold), EasyTouch detects that and performs the action before my finger releases the screen. Is this possible at all?

Minions Rush or Subway Surfers would be great examples of games that have implemented this kind of gesture.

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Swipe
« Reply #1 on: April 21, 2017, 12:31:09 PM »
Hi,

Yes, you can. You have to use On_Swipe rather than On_SwipeEnd event

Offline guillemros

  • Newbie
  • *
  • Posts: 2
Re: Easy Swipe
« Reply #2 on: April 21, 2017, 11:55:45 PM »
Cool thanks for your answer, it's working. I have 4 QuickSwipe scripts on the player now, Up, Down, Left, and Right. The only problem now is that if I keep my finger on the screen and keep swiping around the screen (without letting go), it keeps performing actions one after the other. Is there a way to customize the OnSwipe so that after one of the gestures has been made, you need to let go of the screen before performing another swipe?

Thanks Nicolas!

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Swipe
« Reply #3 on: April 22, 2017, 05:37:08 PM »
Hi,

The only way is now to create your own script with EasyTouch Event ...

And in this case, you have to detect the direction of the swipe, and if the current swipe is no longer on the previous direction cancel the action, and waiting that the player release his finger