Bit code is a necessary "evil" when handling collisions in most physics engines, including SpriteKit. See how bit code works in this tutorial.
- [Narrator] In order to work with collision detection,…it's important to understand bit code.…Now your first question with this may be, why bit code?…Why do I need to understand this…in order to use collision detection in SpriteKit?…Well the masks that we've looked at earlier…are integers that handle physics relationships.…Specifically, there are 32 bit integers.…These integers hold data including which objects…collide with each other and which objects that touch…each other trigger the SKPhysicsContactDelegate events.…
Now for example, in a space ship game,…the player character could collide…with the enemy or an item.…Maybe if the player collides with an enemy,…it bumps into the enemy and the enemy bounces back…or the player bounces back but when it collides…with an item object, it simply picks it up…and there is no physical collision occurring…but we do need to know when it happens so we can respond…and give the player the item.…Now imagine if we have more different objects…than just enemies and items in our game.…
- Creating a SpriteKit project
- Adding and modifying sprites
- Creating sprites in code
- Transitioning between scenes
- Working with children and parents
- Adding physics
- Detecting and responding to collisions
- Applying particle effects
- Creating actions
- Working with sound
- Adding cameras and lights
Skill Level Intermediate
Game Design Careers with Brenda Romerowith Brenda Romero54m 41s Beginner
Careers in the Game Industrywith Christian Bradley1h 19m Beginner
Building a Game App with the Android SDKwith David Gassner2h 6m Intermediate
1. Introduction to SpriteKit
2. Add Physics
3. Work with Particle Effects
4. Work with Actions
5. Work with Audio
6. Additional Features
Next steps1m 41s
- 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.