Join Todd Perkins for an in-depth discussion in this video Preload sounds, part of iOS Game Development with Swift 2.0 and SpriteKit.
- As we've talked about before, there's a little bit…of a delay before audio plays.…So again, I'll demonstrate in this example.…When I release my mouse button,…it takes second before the shooting audio…plays and then it takes another second…before the peg-hitting audio plays.…So I'll release my mouse button now.…So there's a little bit of a delay.…There's some weird graphic stuff going on.…It looks like the ball is warping around so let's fix that.…Note that I've commented out the lines of code…that run the background music and I've done that…because I don't want to talk over that and it's easier…to demonstrate this without having…to talk over background music.…
So now when we run this we're going…to use an AVAudioPlayer, now in order to…do that we're going to need to…import AVFoundation, so make sure you do that.…And at the bottom of didMoveToView I'm going to create…a do statement and after there catch statement.…The reason for that is that when we use the AVAudioPlayer…it could throw an error so we need to…
- Creating a new SpriteKit project
- Adding and modifying sprites
- Transitioning between scenes
- Removing child sprites from parents
- Working with gravity, forces, and impulses
- Detecting collisions
- Applying particle effects
- Creating actions and action sequences
- Working with audio
- Creating frame animations
- Using cameras and lights
Skill Level Intermediate
Programming iOS 9 and GamePlayKitwith Tammy Coron1h 32m Intermediate
1. Introduction to SpriteKit
2. Add Physics
3. Work with Particle Effects
4. Work with Actions
Use an action sequence4m 8s
5. Work with Audio
6. Additional Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.