Join Todd Perkins for an in-depth discussion in this video Understanding collision masks, part of iOS Game Development with Swift 2.0 and SpriteKit.
- View Offline
- Exercise Files
- In our ball shooting game prototype,…let's say we wanted the balls…to collide with these pegs here,…and the walls,…but we want it to go straight through this square.…In SpriteKit, it's easy to do that.…If you're wondering why you might want to do that,…maybe you have an invisible area…where the user maybe scores a point…if the ball goes through a certain spot,…like a basketball hoop or something,…where the ball may not necessarily collide with the net,…but once it goes through the net…you want to trigger a point.…
So that's maybe one of the cases that you might be using…this technique to make an object go through other objects.…So let's look at how that works in SpriteKit.…So on the screen I've added a couple of elements.…So I have these two pegs here, and a square.…Now when I click on the peg,…you'll see that I've added some physics properties,…so it has a Bounding circle, and it's static,…and I've set the Contact Mask to zero.…Now you actually don't have to do that…if you don't have the exercise files for now.…
- 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.