Skip to content

Instantly share code, notes, and snippets.

@Bashta
Created December 2, 2014 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bashta/604997663c02a8369cc3 to your computer and use it in GitHub Desktop.
Save Bashta/604997663c02a8369cc3 to your computer and use it in GitHub Desktop.
GameViewController
import SpriteKit
class GameViewController: UIViewController, GameSceneDelegate {
@IBOutlet weak var skView: SKView!
override func viewDidLoad() {
super.viewDidLoad()
let scene = GameScene(size: skView.bounds.size)
/* Set the scale mode to scale to fit the window */
scene.scaleMode = .AspectFill
skView.presentScene(scene)
scene.gameSceneDelegate = self
}
func gameOver() {
let menuScene = MenuScene(size: skView.bounds.size)
skView.presentScene(menuScene)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment