O'Reilly logo

Getting Started with SpriteKit by Jorge Jordán

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

Playing some music

We all know that music is very important in films as it helps immerse viewers in the story, and this happens in video games too. Depending on the game, you will need to transmit different emotions and highlight actions or situations. Luckily, SpriteKit provides us with a group of utilities to play and handle sounds, making these tasks very simple.

Let's start by creating a new group on the project navigator and adding the needed audio resources:

  • Right-click on the InsideTheHat group on the navigator, select New Group, and call it Sound.
  • Right-click on the Sound group and select Add Files to "InsideTheHat"….
  • In the 7338_02_Resources folder, you will find insidethehat_background.mp3, wrong_door.mp3, and correct_door.mp3. Select them ...

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