How do I detect correctly the position of a multi-touch

Get help using Construct 2

Post » Tue Apr 28, 2015 1:36 pm

Hi,

I have a problem with the Touch plugin, using multi-touch.
I'm working on a multiplayer single-screen project and I want to detect when a touch is released, if it was on P1 side or on P2 side. For this I use
On any touch end
Touch.X<(half canvas size) --> do something
Touch.X>(half canvas size) --> do something else.

It works fine except in one situation : If player 1 start a touch (keep it pressed), then player 2 starts a touch and release it before P1 release his touch. In this case, the game reacts as if Player 1 had just released, not player 2.

It also do it vice-versa, if Player 2 starts a touch (keep it pressed) then player 1 start a touch and release it before player 2 release, the action that should be played when player 2 release is played (should be player 1)

I've exported my game to Android via crosswalk and it doesn't work better than on preview with wifi on iPad.

Any idea? Or any other solution I might use?
B
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Tue Apr 28, 2015 3:39 pm

One would think that the method you devised would work, I tried other methods using both the Touch.TouchID, and Touch.TouchIndex, bot yielding the same result.
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Tue Apr 28, 2015 7:38 pm

I would think so too, but try for yourself :
Image

Here is the capx : https://www.dropbox.com/s/pq2y1jc2deupg ... .capx?dl=0

Try preview over wifi (or export via Intel XDK, I tried both)

Normal behaviors :

touch left : blue square created
touch right : red square appears
touch left (keep), touch right (keep), release left (blue square appears), release right (red square appears)
touch right (keep), touch left (keep), release right (red square appears), release left (blue square appears)

Problematic behaviors :

Touch left (keep), touch right, release right (BLUE square appears), release left (BLUE square appears)
Touch right (keep), touch left, release left (RED square appears), release right (RED square appears)

... ????
Sounds like a multi-touch bug, or is it the normal behavior? @Ashley , any input on this?


I also tried using touchIDs but I had no better result :

On any touch start --> Touch.x<half canvas size --> set variable to touch.touchID
On any touch end --> touch.touchID = variable --> do something

Something like that. Doesn't work either.
I'm using v.202

Is there any way to do that which could work?
B
32
S
6
G
1
Posts: 353
Reputation: 2,821


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests