Join Todd Perkins for an in-depth discussion in this video Respond to collisions, part of iOS Game Development with Swift 2.0 and SpriteKit.
- So we've looked at which objects should physically collide…and react to other objects by bouncing off of them,…but what about responding to code when one object…hits a particular other object?…Let's look at how that works.…To talk about that, we need to discuss one feature…we've talked about very briefly up to this point.…I'll select this wall and let's look at the screen…and look at the feature Contact Mask.…Now we have all of these objects set to zero…and that's significant.…
The zero says, "Don't notify me…"when this object collides with another object."…We have our Ball set to one.…In other words, notify me when objects…collide with other objects.…The Contact Mask actually works…just like the Collision Mask.…We can define what objects, for example,…a ball collides with that we care about.…So by putting one in the Contact Mask,…what else has the number one?…Well, if we look at our GameScene,…the Collision Category for a wall is one.…
So what this is actually saying is…"Notify me in my code only…"when a ball collides with a wall."…
- 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.