Book Image

Game Development with Swift

By : Stephen Haney
Book Image

Game Development with Swift

By: Stephen Haney

Overview of this book

Table of Contents (18 chapters)
Game Development with Swift
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Checkpoint 5-A


To download my project to this point, browse to this URL:

http://www.thinkingswiftly.com/game-development-with-swift/chapter-5

Preparing for endless flight

In Chapter 6, Generating a Never-Ending World, we will build a never-ending level by spawning tactical obstacle courses full of these new game objects. We need to clear out all of our test objects to get ready for this new level spawning system. Once you are ready, remove the spawning test code we just added to the GameScene class. Also, remove the six lines that we have been using to spawn the three bees from previous chapters.

When you are finished, your GameScene class's didMoveToView function should look like this:

override func didMoveToView(view: SKView) {
    // Set a sky-blue background color:
    self.backgroundColor = UIColor(red: 0.4, green: 0.6, blue: 
        0.95, alpha: 1.0)
    
    // Add the world node as a child of the scene:
    self.addChild(world)
    
    // Store the vertical center of the screen:
...