How do I prevent multi-touch

Get help using Construct 2

Post » Tue Jun 24, 2014 5:45 pm

Hi everyone,

I have a 'clicking counting' problem in which I want to prevent the use of multi-touch.

Basically I want the system to only count one touch at a time, not two touches if the user presses both fingers on the screen at the same time.

I know there is a way to do this using variables, but is this the best way?

The app is for mobile.

Thanks!
B
13
S
6
Posts: 130
Reputation: 1,553

Post » Tue Jun 24, 2014 8:03 pm

Use On Nth Touch Start (or End if that's your case) and set touch number to 0, instead of Any Touch Start (or End) to trigger the counting.

You can check an example at this URL:
http://www.gamesintheattic.com/examples/uniqueclicks/

(or read the code below with your phone if you don't want to type it)

Image

And you can download the .capx here:
http://www.gamesintheattic.com/examples/uniqueclicks.capx
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 417
Reputation: 2,315

Post » Wed Jun 25, 2014 7:17 am

Hi brunopalermo,

your answer is spot on - thank you very much! I wish I could give you some 'rep' for such a good answer (the qr code was a lovely touch)!

Since you were so good with this problem would you consider thinking about this issue? I wouldn't usually cross post but this is a major headache for me.

"https://www.scirra.com/forum/how-do-i-stop-the-players-score-being-lost_t108964"

Thanks for your time :)
B
13
S
6
Posts: 130
Reputation: 1,553


Return to How do I....?

Who is online

Users browsing this forum: blue visionary, namaewayukidesu and 6 guests