April 2021
Beginner to intermediate
506 pages
11h 57m
English
As you learned earlier, the loadSceneForLevel(_:) method in the SKScene+SceneManager.swift file is responsible for loading the correct game scene depending on the level the player is about to begin. It does so using the following code:
| | GKScene(fileNamed: "GameScene_\(level)") |
The value stored in the level argument determines which game scene file to load; for example, the GameScene_1.sks file represents Level 1, the GameScene_2.sks file represents Level 2, and so on. Of course, none of these files exist right now, so you’ll need to make at least one—and the easiest way to do so is to rename what you already have.
In the Project Navigator, select the GameScene.sks file and rename it GameScene_1.sks. (Note: ...
Read now
Unlock full access