Game Development Reference
In-Depth Information
At this point, your target settings should look like
Figure 1-4
.
Figure 1-4
.
The SuperSpaceMan target settings
The next thing you need to do is delete the file
GameScene.sks
. You will not be using
the level editor in this topic. You can find this file in the SuperSpaceMan group. Delete
this file and then open
GameScene.swift
and replace its contents with the class in
Listing 1-1
.
GameScene.swift: The SuperSpaceMan Main GameScene
import SpriteKit
class GameScene: SKScene {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override init(size: CGSize) {
super.init(size: size)
backgroundColor = SKColor(red: 0.0, green: 0.0,
blue: 0.0, alpha: 1.0)
}
}
There is one more change you need to make before examining your baseline project. Open
GameViewController.swift
and replace its contents with the
Listing 1-2
version
of the same class.
Listing 1-2
.
GameViewController.swift: The SuperSpaceMan Main UIViewController