【发布时间】:2021-10-27 23:57:20
【问题描述】:
对于我正在创建的游戏,当按下开始按钮时,我在开始时会有一些动画。但是,能够触摸屏幕会干扰此动画。有什么方法可以让用户在单击开始按钮后(比如说 10 秒)之前无法与屏幕交互?这是我为当前用户触摸的代码:
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
}
}
【问题讨论】: