Ignoring touch events for GameView?

choffi

Member
Licensed User
Longtime User
Hi

I have a game I have created which relies on the user tapping the screen to activate balls in a grid. The problem I have is that every now and then the tapping of a ball results in a chain reaction of balls "dissolving" which is animated and can take a few seconds to resolve.

in the meantime, if the user has tapped anywhere else on the screen then those touch events all take effect after the animation has finished. But by then the location of balls on the screen has changed so the user sometimes ends up tapping balls they did not intend to.

Ideally what I need is a way of making the GameView ignore any touches that happen whilst the animations are underway. I have tried setting a flag and checking the value of this and then trying to skip the code within the touch event handler. But this does not work. The touch events all appear to be queued up and effected after the animation finishes.

Any ideas on how I can make this work?

Thanks

Mark
 

JonPM

Well-Known Member
Licensed User
Longtime User
I'm guessing it's because all of the events are being ran on the same thread. Have you tried using a timer instead? Not sure if it will work but might be worth a try.
 
Upvote 0
Top