Setting up a project
We have discussed many things about Sprite Kit, now it's time to see a project in action and gain some practical knowledge.
The Hello World project
We'll need to create a new project to build Hello World
. An Xcode project organizes everything your app needs into one convenient place. Let's begin by creating a brand new game project in Xcode by carrying out either of the first two points, and then continuing as shown in the list:
- Click on Create a new Xcode project on the welcome screen:
- Instead, you can also select File | New | Project… from the file menu:
- Select Game from the new project selection window:
- The next window asks you to customize options for your project. Fill out the fields as shown in the following screenshot:
- Product Name: It is the name of the game
- Organization Name: If you are an individual, then your name, or the name of the organization
- Organization Identifier: A unique identifier of your organization
- Bundle Identifier: It is a default ID generated automatically using organization identifier and product name.
- Language: The programming language you are using, that is, Objective-C or Swift
- Game Technology: The game framework being used, like Scene Kit, Sprite Kit, Metal, and so on
- Devices: The devices you want your game to run on; iPad, iPhone, or both
- These fields can be anything you want
- Press Next and Xcode will ask where to save your new project. Choose a directory and then click on Create.
- After saving, it should open Xcode to your brand new
Hello World
project, specifically to the project properties screen. On this screen, unselect the Portrait option under Device Orientation. This file will be automatically saved, so you won't have to do anything further: