April 2021
Beginner to intermediate
506 pages
11h 57m
English
In the Project Navigator, select the GameViewController.swift file to open it in the Source Editor. Locate and review the viewDidLoad() method. It looks like this:
| | override func viewDidLoad() { |
| | super.viewDidLoad() |
| | |
| | // Load 'GameScene.sks' as a GKScene. This provides gameplay-related content |
| | // including entities and graphs |
| | if let scene = GKScene(fileNamed: "GameScene") { |
| | |
| | // Get the SKScene from the loaded GKScene |
| | if let sceneNode = scene.rootNode as! GameScene? { |
| | |
| | // Copy gameplay-related content over to the scene |
| | sceneNode.entities = scene.entities |
| | sceneNode.graphs = scene.graphs |
| | |
| | // Set the scale mode to scale to fit the window |
| | sceneNode.scaleMode ... |
Read now
Unlock full access