Game Development Reference
In-Depth Information
There is one last change that needs to be made, and that is to turn off accelerometer up-
dates when the
GameScene
is no longer used. To do this, add the following
deinit()
method to the bottom of the
GameScene
and save your changes:
deinit {
self.coreMotionManager.stopAccelerometerUpdates()
}
Summary
In this chapter you started to add some real functionality to your game. You began by
making some small restructuring changes to the beginning of the game. After that you ad-
ded additional
orbNode
s to collide with. After adding the new
orbNode
s, you added
scrolling to your game scene, making it look like the player was flying through space col-
lecting orbs. And finally, you closed out the chapter using the phone's accelerometer to
move the player along the x-axis.
In the next chapter, you will continue adding new game elements as well as start animat-
ing your
SKSpriteKitNode
s. That is the chapter where you will start turning your
game into a real, playable game.