Track only one touch?

Get help using Construct 2

Post » Thu Aug 16, 2012 2:21 am

Hello, I am trying to make a reflex based game where the use can move certain objects around the screen. For balance reasons, only one touch should be used to manipulate objects.

One solution I tried was to have a variable track the fingers by adding one for every new touch and subtracting one for every touch end. Then every manipulable object would have a condition stating that the touch count must be fewer than one.

The problem with this is that whenever I touch a second finger and then remove it, the variable changes to zero, which makes all the object manipulation stop. This inadvertently punishes the player for trying to use two fingers, but also causes problems for players who might be holding a phone and let a thumb slide onto the edge of the screen. I am not sure why the variable changes to zero, since the event is to subtract 1 per touch end.

Is there a simple way to make the game only track whatever the first touch point was?

Thanks for your time!
B
3
G
1
Posts: 1
Reputation: 827

Post » Tue Nov 20, 2012 6:22 am

Bump!! i need to know this too.
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Tue Nov 20, 2012 7:02 am

I haven't tested this on a tablet, but I think this may work. It makes only one sprite dragable at any given time, so the use of a variable isn't nescisarily needed.

https://dl.dropbox.com/u/108799982/Capx%20Demos/TouchDrop.capx
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125


Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 26 guests