O'Reilly logo

Getting Started with SpriteKit by Jorge Jordán

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a main menu

When playing mobile games, you will usually find an initial menu screen when you run it. These screens are usually shown to provide players with a way to modify some configurations, such as turning on or turning off of the game sound, the selection of a game's difficulty, or just a way to hide a big load of components.

We are going to create a menu that will be shown when the game is run, where we will show a background and a button to start playing the game.

For this purpose, we will need to create a new scene file to manage this new screen behavior. To do so, perform the following steps:

  1. In Xcode, select the File menu at the top of the screen.
  2. Select New | File, and you will see the Files dialog box.
  3. Select the Swift File option ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required