How do I swipe a block accross the screen

0 favourites
  • 10 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I have 2 blocks , I would like to swipe them one at a time right,left,up,down with my finger. How do I achieve this with the touch input.

  • Use Drag & Drop behaviour

  • Use Drag & Drop behaviour

    Thanks for the reply, I did use drag and drop but how do I make the box continue to slide for a little after I take my finger off it?

  • Try this link you might find what you looking for

    https://www.scirra.com/tutorials/636/ma ... en-android

  • Try this link you might find what you looking for

    Thanks but this is not exactly what I'm trying to do.

    I'm trying to swipe the boxes individually around the screen with finger but when I take my finger off the box it does not continue in the direction I swiped it for a short distance. I got the boxes to move with drag and drop but when I take my finger off the box it stops right away.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You just check the direction it was going when it was dropped.

    Like if the x when it was dropped was so much greater than the x it had when it was picked up, then you know it was swiped right.

  • You just check the direction it was going when it was dropped.

    Like if the x when it was dropped was so much greater than the x it had when it was picked up, then you know it was swiped right.

    how do I go about doing this ?

  • On drag, or touch store the x, and y of the object to a variable.

    Then when its dropped compare the objects position to the variables.

    You'll need extra sub events for all the different directions you want to compare.

  • On drag, or touch store the x, and y of the object to a variable.

    Then when its dropped compare the objects position to the variables.

    You'll need extra sub events for all the different directions you want to compare.

    Can you show how the commands should look in construct? maybe a screenshot please ?

    edit , I'm new at this

  • Might check the how-to examples:

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