[Touch] How to move two objects simultaneously

0 favourites
  • 1 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • 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.


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)