Join Todd Perkins for an in-depth discussion in this video Use bitmasks, part of iOS Game Development: Swift 2.0 and SpriteKit.
- When handling collisions in Sprite Kit,…it's important to understand a little bit about…how bits work.…So if you're already familiar with using bits in code,…you can skip ahead if you'd like.…So I'm going to create a variable here called bits,…and it's important that I'm using a playground…because I'm just demonstrating how this works.…That way we don't have to keep testing the application…to see the results of the code.…So bits, and I'm going to data type this to a UInt32.…So we have a positive 32bit interger…and then I'm going to set it equal to 0x1.…
Now if you look at the right side of the screen,…this is the result, is one.…Now, these numbers are coming from the binary numbers,…ones and zeros.…So this is the one, all the way on the right.…So the digit all the way on the right is either representing…one, if it's a one, or zero, if it's a zero.…Now I'm going to add this little operator,…which is the bit shift operator, and have it be zero.…So what this says is, shift the bit to the left.…And it's going to do this zero times.…
- 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
iOS 9 App Development: 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.