Skip to content

Instantly share code, notes, and snippets.

@lucasprag
Created January 29, 2016 19:13
Show Gist options
  • Save lucasprag/0d08021a6d35c0160990 to your computer and use it in GitHub Desktop.
Save lucasprag/0d08021a6d35c0160990 to your computer and use it in GitHub Desktop.
present the game over scene
// 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