Product College starts on September 18. Submit your application today. Apply now.

Setting up a new project

Setting up a new project

April 12, 2017
Expand

Project: Learn to buid Conway's Game of Life with SpriteKit and Swift 3

Create a new SpriteKit project

Create a new Game project in Xcode named Gameoflife and check the Language is set to Swift and Game Technology is set to SpriteKit.

Xcode new project

Importing Resources

Download the Game of Life Art Pack we created for you. Once the download is complete, unpack the folder. Click on the Assets.xcassets folder and drag across the assets.

Xcode add assets

These assets were designed with the 4" retina resolution.

Adding extra functionality

SpriteKit doesn't include a button class you will have to add your own!

Download the MakeSchool Utilities, unpack and drag the file 'MSButtonNode.swift' into the project (we don't need the rest). Ensure Copy items if needed is checked.

Xcode add utils

Device orientation

The game assets were designed for landscape orientation, so you should ensure that the game will not accidentally use portrait.

Open the target settings.

Uncheck any Portrait options and check the Landscape options.

Xcode Target Settings

Clean project

To ensure a clean starting point, ensure your GameScene.swift reads as follows:

import SpriteKit

class GameScene: SKScene {

    override func didMove(to view: SKView) {
        /* Setup your scene here */
    }

    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        /* Called when a touch begins */
    }

    override func update(_ currentTime: TimeInterval) {
        /* Called before each frame is rendered */
    }
}

Summary

Great, now you have a new project ready to begin building the Game of Life. In the next chapter you will focus on creating the user interface.

Feedback

If you have feedback on this tutorial or find any mistakes, please open issues on the GitHub Repository.

Summer academy

An iOS Development Summer Course

Design, code and launch your own app. Locations across the USA and Asia

Find your location

Product College

A computer science college

Graduate into a successful career as a founder or software engineer.

Learn more