Button Trigger Problem
Fal01
Member Posts: 460
Hi all,
I have a button in my game that when pressed triggers certain attributes-ie when touch count =1 -60 coins
The problem I have is that if you press it really quickly it doesn't have time to trigger the attributes and you end up with varying degrees of wrong results.
I've tried a timer on the touch count but it doesn't help.
Any help would be greatly appreciated.
I have a button in my game that when pressed triggers certain attributes-ie when touch count =1 -60 coins
The problem I have is that if you press it really quickly it doesn't have time to trigger the attributes and you end up with varying degrees of wrong results.
I've tried a timer on the touch count but it doesn't help.
Any help would be greatly appreciated.
It’s not a bug – it’s an undocumented feature
Best Answer
-
contrasthall Posts: 131couldn't imagine the problem then but if a quick double touch is giving you a problem you could make a true false "lets call it wait" so when touched and wait is false then counter = counter + 1 wait is true.
outside of that rule do a if wait is true then after .5 seconds timer wait is false...
Answers
Yeah it's a quiz game and the rules are basically set up like this-
The button in question reveals hints from a table, there are 3 hints per level.
There is an index attribute that counts the times you press the button.
So if button count = 1-(reaveal hint 1), take away 60 coins, attribute (show hint 1)=true
if button count=2-(reveal hint 2), take away 60 coins, attribute(show hint 2)=true
And the same for the third hint.
It works fine if you press the button with a gap between the presses but if you press it fast repeatedly it gets messed up.
Hope this makes sense!
It’s not a bug – it’s an undocumented feature
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
then if counter = 1 do this
if counter = 2 do this
side note you could should probably also set inside the button to do nothing to the counter if its at your top number which sounds like 3 so the actual rule in the touch is if counter < 4 then counter = counter +1
@jamie_c, I have tried that but for some reason it took off double the amount of coins and I couldn't figure out why.
It’s not a bug – it’s an undocumented feature
It’s not a bug – it’s an undocumented feature
It’s not a bug – it’s an undocumented feature