1
我試圖讓一個節點執行一個動作,然後在按下按鈕之後進行場景轉換。Skaction其次是場景轉換
這是我到目前爲止有:
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
var touch = touches as! Set<UITouch>
var location = touch.first!.locationInNode(self)
var node = self.nodeAtPoint(location)
var action = SKAction.moveToY(PlayButton.position.y + self.size.height, duration: 5)
// If next button is touched, start transition to second scene
if (node.name == "Balloon") {
PlayButton.runAction(action)
var secondScene = Scene2(size: self.size)
var transition = SKTransition.flipVerticalWithDuration(1.0)
secondScene.scaleMode = SKSceneScaleMode.AspectFill
self.scene!.view?.presentScene(secondScene, transition: transition)}
}
當我點擊使用模擬器不執行動作場景轉換按鈕。
謝謝!很棒 – Yraw