For the game I am creating, I have a little animation of sorts at the beginning when the start button is pressed. However being able to touch the screen interferes with this animation. Is there any way I can have the user not be able to interact with the screen until (lets say 10 seconds) after the start button is clicked? Here is my code for the current users touch:
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let location = touch.location(in: self)
player.position.x = location.x
player.position.y = -300//location.y
}
}
2
Answers
Stop ClickEvent in entire screen.
Continue ClickEvent after some time, i.e.: 10 Sec.
You can disable user interaction while clicking on the screen and enable it after 10 second as-
If you want to disable user interaction for 10 seconds after clicking the start button for the first time, then copy this code
and paste it inside your Start button action function.