Exploring the SpriteKit demo
Use the project navigator to open up the file named GameScene.swift. Xcode created GameScene.swift to store the default scene of our new game.
What is a scene? SpriteKit uses the concept of scenes to encapsulate each unique area of a game. Think of the scenes in a movie; we will create a scene for the main menu, a scene for the Game Over screen, a scene for each level in our game, and so on. If you are on the main menu of a game and you tap Play, you move from the menu scene to the Level 1 scene.
SpriteKit prepends its class names with the letters "SK"; consequently, the scene class is SKScene.
You will see that there is already some code in this scene. The SpriteKit project template comes with a very short demo. Let's ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access