Create Additional Game Scenes

Apple Game Frameworks and Technologies — by Tammy Coron (146 / 193)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Exit the Map and Load the Next Scene | TOC | Support 3D Spatial Audio Effects 👉

To create your new game scenes, you’ll be using the naming convention of GameScene_#.sks where the # symbol represents the level number. You already have GameScene_1.sks, so the next scene to create is GameScene_2.sks.

You’re welcome to create the new scenes on your own or copy the examples in the resources/levels folder. The examples are all very similar with one exception: the exit is in a slightly different spot.

Should you choose to copy the pre-made scenes, simply drag the files into the Scenes group in the Project Navigator and you’ll be ready to go.

If, however, you’d rather make the new levels yourself, there’s something you can do to help speed up the process: use custom Xcode templates.

To create a new Xcode template, copy the AGFT Book folder from the resources/levels/template folder into your ~/Library/Developer/Xcode/Templates/File Templates folder. This step creates a new Xcode template, which you can then access from the New File window, as shown.

images/AddingMoreScenesAndSavingTheGame/xcode-template.png

Build and run the project to check out your new levels.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.