Chapter    7

Main Scene and Game State

So far we’ve fully neglected the main scene, where the game’s main menu ought to be. The main menu is a good place to add a Settings menu that allows you to change the volume of background music and sound effects.

The settings popover requires a grid-based layout, which is why you’ll use the Box Layout node for the first time. You’ll also add a way to store the game state permanently—for instance, unlocked levels and audio volumes—so that it doesn’t get lost if the app is terminated.

Main Scene Background

It’s time to give the game’s main menu a make-over. Right now MainScene.ccb is still the pale, blue scene with the SpriteBuilder label and a play button.

Designing the Background Images

In the previous ...

Get Learn SpriteBuilder for iOS Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.