Creating our SpriteKit game
Now that we know the goal of our game, here's how we go about building it in SpriteKit:
- First, open Xcode and create a new project.
- Now select the Game template and click on Next.
- Next, fill in the product name. We will name this project
SwiftSweeperExample
and make sure that the language is Swift with SpriteKit selected as the game technology as well as the devices set to iPhone. - Then, click on Next, and we now have a brand new SpriteKit game project with a number of files already written up for us to get us started.
- Now click on the project's main file in the navigation pane and deselect all but the Portrait selection in the Device Orientation field.
- Since we are going to work mostly with code, we can also either ignore or delete the
GameScene.sks
file for now. These files are Xcode's option for you to visually design your game scene. We will know more on these files later when we work with our more visually designed SpriteKit game example. - Build and...