How do I dissable fast touches?

Get help using Construct 2

Post » Fri Jul 18, 2014 10:03 pm

Hi Scirra people!


Im having a problem in my game, when the player is touching objects to fast.
Is there a way to dissable the touch object if it gets abused? ie when a player touches the objects in the game too fast.


Any help would be apreciated!
B
37
S
9
G
8
Posts: 541
Reputation: 8,554

Post » Fri Jul 18, 2014 10:14 pm

@xanxion

Maybe only allow Touch when a variable is equal to 0.

So on each Touch you set the variable to 1 and start a timer (e.g. for 0.5 seconds) and when the timer finishes set the variable back to 0 allowing Touch again.

That way the player can only Touch every half second.

Something like:
Code: Select all
Touch->Is touching object
System->Compare TouchVariable = 0
   Do touch action
   System->Set TouchVariable = 1

System->Compare TouchVariable = 1
   System->Wait 0.5 seconds
   System->Set TouchVariable = 0
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
33
S
9
G
7
Posts: 450
Reputation: 6,780

Post » Sat Jul 19, 2014 2:59 pm

Good idea, thanks for it.. I should have thought of that!

Thanks!
B
37
S
9
G
8
Posts: 541
Reputation: 8,554

Post » Sat Jul 19, 2014 3:09 pm

i tried it, but it didnt really work with my setup, because i use a picking sensor system.

Any other ideas out there?
B
37
S
9
G
8
Posts: 541
Reputation: 8,554


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, marc254, rbailey83 and 24 guests