O'Reilly logo

Swift Game Development - Third Edition by Stephen Haney, Siddharth Shekar

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

Adding Options to the Menu Scene

Create a new file called OptionsScene.swift.

Next, add in the assets for the Options Scene menu button, mute, unmute, slider base, and slider knob assets from the chapter and add them into the Assets.xcassts file. Add them under the HUD folder as follows:

Adding Options to the Menu Scene

In the OptionsScene class, add the following properties for the texture atlas, mute button, slider base, slider knob, and menu button:

import SpriteKit class OptionsScene: SKScene { // Grab the HUD sprite atlas: let textureAtlas:SKTextureAtlas = SKTextureAtlas(named:"HUD") let muteButton = SKSpriteNode() let sliderBase = SKSpriteNode() let sliderKnob = SKSpriteNode() ...

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