《Val’s Revenge游戏开发:场景拓展与数据保存》
1. 触摸方法更新
首先,需要更新覆盖触摸方法,以适应它们各自调用方法中的新参数。修改后的代码如下:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for t in touches {self.touchDown(atPoint: t.location(in: self), touch: t)}
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
for t in touches {self.touchMoved(toPoint: t.location(in: self), touch: t)}
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
for t in touches {self.touchUp(atPoint: t.location(in: self), touch: t)}
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
for t in touches {self.touchUp(atPoint: t.location(in: self), touch: t)}
超级会员免费看
订阅专栏 解锁全文
24

被折叠的 条评论
为什么被折叠?



