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
38
S
10
G
9
Posts: 542
Reputation: 9,181

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
Find all the Construct 2 games that were on Steam Greenlight here
B
42
S
11
G
7
Posts: 513
Reputation: 7,355

Post » Sat Jul 19, 2014 2:59 pm

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

Thanks!
B
38
S
10
G
9
Posts: 542
Reputation: 9,181

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
38
S
10
G
9
Posts: 542
Reputation: 9,181


Return to How do I....?

Who is online

Users browsing this forum: clarkcbrawley, ShinyBOI and 61 guests