Chapter 6
Juicing Your Games with Sound and Effects

In the previous chapter, you worked with the SKLabelNode class and added some labels to the scene to keep the player informed of things like the current level and score. You also learned about the game loop and how you can leverage the like soframe-cycle methods to implement your game logic. Gloop Drop is fully functional at this point, but it’s missing something: game juice.

Game juice is a common term used within the game development community. When you add juice to your game (aka, juicing), what you’re doing is improving the overall look and feel of your game. For example, you might add subtle audio and visual effects or tweak certain aspects of the user controls.

Although juicing casts a wide net, the primary goal is always to enhance gameplay and set the emotional tone for your game, such as fear for a horror game or action-packed fun for an arcade game.

In this chapter, you’ll get warmed up by adding sound effects and background music. After that, you’ll move on to tweaking some of the visual effects and animation sequences—this is where you’ll learn how to add a scrolling background to make a continuous flow of gloop beneath the player. From there, you’ll add a little more juice using SpriteKit’s Particle System and emitter nodes to make the flow of gloop a little more interesting.

To begin, open the gloopdrop project in Xcode.

Before you start adding juice, you need to remove the debug view options to get a better idea of what players will see when they play the game.

In the Project Navigator, select the GameViewController.swift file to open it in the Source Editor. Find the viewDidLoad() method and update the view options, like so:

 

 // Set the view options
 view.ignoresSiblingOrder = ​false
 view.showsPhysics = ​false
 view.showsFPS = ​false
 view.showsNodeCount = ​false

This change removes the blue physics bodies outlines, along with the FPS and node counts that show up in the bottom-right corner of the game.

With those view options out of the way, you’re ready to get started.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset