我不知道出了什么问题,但是下面的代码在switch语句中给了我很多错误:
enum GameState {
case Start
case Tutorial
case Play
case ShowingScore
case GameOver
}
在GameScene课程中:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
for touch: AnyObject in touches {
let location = touch.locationInNode(self)
switch GameState {
case .Start: break
case .Tutorial: break
case .Play:
beginningTouchPosition = location
tappedForBird = true
break
case .ShowingScore: break
case .GameOver: break
}
}
}
我收到的错误消息是:
答案 0 :(得分:4)
您正在启用枚举类型GameState
您应该打开一个包含GameState