Join Todd Perkins for an in-depth discussion in this video Add physics properties to sprites, part of iOS Game Development: Swift 2.0 and SpriteKit.
- Physics can add a lot to a game…and fortunately, SpriteKit makes adding physics easy.…Let's look at how that works.…I'm starting in a basic template project for SpriteKit,…except for I gutted out the code in GameScene.swift…and I've added my own sprites as assets,…and I've changed the game scene just a little bit…to add a white background…and changed the size to 1080 by 1920.…So we'll add physics using some boxes to start out with.…So let's make some walls on the sides.…
So I'll make this block into a wall…and then Option drag it to copy it to the other side,…and then I'm going to make a floor.…Stretch it out like that,…doesn't matter if it's a little bit too big.…And then I'm going to add a ball that will bounce around.…So I'll change the texture to Ball and there we have it.…So what we want to do is make these walls…actually act like walls and be solid and not move…and have the ball move and be a little bit bouncy.…
To do that, I'll select a wall and then scroll down…in the Attributes inspector to Physics Definitions.…
- 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
Game Design Careers with Brenda Romerowith Brenda Romero54m 41s Beginner
iOS 9 App Development: GamePlayKitwith Tammy Coron1h 31m 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.