Tuesday, March 11, 2014

Making sense of Sprite Kit and iOS's MVC

Sprite Kit flow in English-speak

From the ViewController’s viewDidLoad we configure the view by doing the following:

1. Create a game view by casting the ViewController’s view to SKView

    SKView has some properties like:

         showsFPS, showsNodeCount, showsDrawCount

2. We create game scene via instance of a class that derives from SKScene

3. Then we call game view’s presentScene to present the game scene

A game scene extends SKScene. On game scene’s initialization: 

1. We can set the size of the scene, from the scene we can also set the background color. 

2. We can add a player (instance of SKSpriteNode) on game scene by calling the game scene’s addChild which has a parameter of SKSpriteNode

No comments:

Post a Comment