how to touch and swip

0 favourites
  • 3 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hi all my Quastion is: i want to touch and swipe tree, for example i want to touch on tree and swipe to left this tree image. when touch on tree and swipe tree to left i can set animation for that. like with Angry birds game

  • Okay so...

    You need to have an object that you can test for when touching. My guess is that would be the tree. Second you need an object to the left of the tree. that is invisible. Create a variable called touchdt.

    When you touch the tree, set touchdt to 0

    everytick add dt to touchdtt

    If touch overlaps the object on the left and touchdt < some value (0.3 seconds?) then play the animation.

    You could also do this by tracking touch location, adding up the change in position over x amount of time and if the change in position after touching the tree is greater than x, call it a swipe so long as the player never stopped touching the screen during the add up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • try this click or touch tree and see

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