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.
Develop games in your browser. Powerful, performant & highly capable.
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
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.
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: