Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Transitioning back to gamescene.swift causes error

mattdryermattdryer 94538Posts: 5New Users Noob
edited February 2015 in iOS SDK Game Development
My app contains two scenes. Playscene.swift and gamescene.swift.

Transitioning from gamescene to playscene (where play takes place) works perfectly. However, once a gameover is reached, I have a "replay" button appear allowing the user to return back to gamescene.swift. Upon transitioning back it crashes with no explained error.

if self.nodeAtPoint(touchLocation) == self.replay {

    let skView = self.view as SKView!
    let scene = GameScene(size: skView.bounds.size)

    let transition = SKTransition.crossFadeWithDuration(1.0)
    transition.pausesOutgoingScene = false

    self.view?.presentScene(scene, transition: transition)

Post edited by mattdryer on


Sign In or Register to comment.