Sometimes you'll want to clone a node. This tutorial shows how to spawn clones in SpriteKit so that you can avoid writing more code than necessary.
- [Instructor] Let's say you're making a space shooter game,…and you want to be able to shoot lasers.…So you're going to need to spawn lasers every so often.…Now, there's not an easy way…built into SpriteKit to do that.…Let me show you what I'm talking about.…First, I want to point out in my scene that I have no gravity,…so it's set to zero x and zero y,…which is appropriate for this kind of game.…If I select my laser object,…you'll see that I have it set to a color,…it's just a color sprite,…and then I have it set for a bounding rectangle,…and then I have some settings set up.…
Now, I've set linear damping to zero,…and I want to point out what that is.…Damping is slowing down an object,…so linear damping slows down the movement over time.…So think of throwing a baseball,…and it doesn't always go at the same speed…when you throw it,…it slows down over time,…that's what linear damping aims to create.…I've turned it to zero here for a space shooter,…because the laser doesn't need to slow down over time.…
You want it to go at a constant speed.…
- 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.