Created
January 29, 2016 19:13
-
-
Save lucasprag/0d08021a6d35c0160990 to your computer and use it in GitHub Desktop.
present the game over scene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// omitted | |
class GameScene: SKScene, SKPhysicsContactDelegate { | |
// omitted | |
func gameOver() { | |
player.removeFromParent() | |
for enemy in enemies { | |
enemy.removeFromParent() | |
} | |
// transition effect that seems like doors opening | |
let reveal = SKTransition.doorsOpenHorizontalWithDuration(0.5) | |
// create the scene | |
let gameOverScene = GameOverScene(size: self.size) | |
// present the game over scene with the transition | |
self.view?.presentScene(gameOverScene, transition: reveal) | |
} | |
// omitted | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment