这是我的代码(2个错误):
override func viewDidLoad() {
super.viewDidLoad()
//ERROR HERE - "Expected type after as"
let skView = view as! SKView
skView.multipleTouchEnabled = false
//Create and configure the scene
scene = GameScene(size: skView.bounds.size)
scene.scaleMode = .AspectFill
scene.tick = didTick
swiftris = Swiftris()
swiftris.beginGame()
//Present the scene
skView.presentScene(scene)
//ERROR HERE - Braced block of statements is an unused closure
scene.addPreviewShapeToScene(swiftris.nextShape!){
self.swiftris.nextShape?.moveTo(StartingColumn, row: StartingRow)
self.scene.movePreviewShape(self.swiftris.nextShape!){
let nextShapes = self.swiftris.newShape()
self.scene.startTicking()
self.scene.addPreviewShapeToScene(nextShapes.nextShape!) {}
}
}
}
不知道什么是错的家伙,请帮忙! 我是Swift的新手,我正在关注Bloc.io发布的代码 这是一个创建像俄罗斯方块 - Swiftris这样的游戏的介绍教程。教程链接: https://www.bloc.io/tutorials/swiftris-build-your-first-ios-game-with-swift#!/chapters/684
答案 0 :(得分:0)
要寻找的东西:
第二个错误可能是因为SKView错误。