Join Todd Perkins for an in-depth discussion in this video Modify sprites in code, part of iOS Game Development: Swift 2.0 and SpriteKit.
- So now we're going to look at…modifying sprites through code.…So I have this cannon here at the top,…and let's say I want to point it…based on the percentage…that my finger is dragged across the screen.…So my fingers all the way on the left side,…the cannon should be facing this way.…And when it's all the way on the right side,…the cannon should be facing this way.…So we're going to need a few different things…to do that.…First we're going to need to make sure…that the cannon is going to rotate…along the right axis.…So, we need to change its anchor point.…
When I select the cannon,…you can see that the anchor point…is that white circle and it's in the center.…What we want the anchor point to be is right here…on the left edge in the center.…And that way it'll rotate around that point.…So if I rotate it now,…you can see that it's rotating around its center.…But I want it to rotate around the left center.…So let's look at how that works.…I'm going to Command Z to undo that change.…Select the cannon again.…And then I'm going to go to the anchor point section.…
- 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.