1

I am a newbie to spritekit game development.

Now I have created a basic game scene like a plane shooting enemies.

But how to implement more interactive stuff like play/pause, game start and game over?

My question is, are those scenes embedded into the game scene as nodes, or they are different SKscenes?

Thank you all!

Mix
  • 459
  • 1
  • 7
  • 20
  • 3
    Ray Wenderlich Tutorials are really good and there are lots of them http://www.raywenderlich.com/42699/spritekit-tutorial-for-beginners – MikeJ Oct 29 '15 at 10:52
  • 3
    I always recommend people to use just one scene and instead use parent nodes to transition between interfaces. Not only will this make memory allocation a little more clear, you will also have the luxury of making your own custom scene transitions and do things like keep a background throughout all your scenes. For example, let's say you want a background to appear throughout all of your scenes, well if you used Apple's SKScenes approach you would need to continuously add this background nodes to every single Scene. This is extremely inefficient and a major flaw with SKScenes. – Epic Byte Oct 29 '15 at 11:25

1 Answers1

2

You can create new scenes and transition to them (swift example) - Create a new swift file for your new scene

class SceneTwo: SKScene {
 override func didMoveToView(view: SKView) {

 } 
}

In your main or first scene you can transition to your new scene in the following way....

let sceneTwo = SceneTwo()
let transition = SKTransition.doorwayWithDuration(1.0)
self.view?.presentScene(sceneTwo!, transition: transition)

You can pause any scene....

self.scene.view.paused = YES
MikeJ
  • 2,367
  • 3
  • 18
  • 23