[Touch] How to move two objects simultaneously

Get help using Construct 2

Post » Sun May 26, 2013 11:22 am

Im trying to make a game work on my android tablet using cocoonJS, and while everything seems nice, im just having trouble figuring out how to have the game constantly knowing which touch is which.

When searching around on the forums, I found something about problems with assigning touch IDs in some ways, but apart from that i didnt get much. I found something about moving blocks around but that wasnt simultaneous (And even so sort of bugged)

What do i have to do to have one sprite follow the finger that touched it, and have another sprite follow the finger that touched it while the first finger is still holding?

And when one object is released from touch, the other object shouldnt be affected at all.

What i tried so far:

* Drag & Drop: It works, but it makes it hard for me to control how fast the object is supposed to follow the finger (as in lerped movement speed) and other various movement-controls depending on other factors. Unless i can control Drag&Drop in advanced ways which i dont see.

* When being touched, assigning a global variable the ID of the touch, and then set movement to the touch.XatID and YatID while still in touch. But this gives my objects some reeeeally strange behaviour just running off screen and stuff.

However, i might just be really bad at figuring out how to use the touch id thingy, which is why i researched but didnt find much that helped me :/

Any help appreciated as always, and sorry if this is covered somewhere i just didnt find yet.

Posts: 21
Reputation: 1,242

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest