Game Development Reference
In-Depth Information
Chapter
6
Adding Particle Effects to Your Game with
Emitter Nodes
In the previous chapter, you refactored the orb node's layout and saw how you could use
SKActions to move an SKSpriteNode back and forth across the scene while making
that same node rotate forever. At the end of the chapter, you looked at how you can add
colorizing effects to an SKSpriteNode using a colorize action.
In this chapter, I will show you how to define particle emitters and how to leverage them in
Sprite Kit games. After that, I will show you how you can use them to add engine exhaust
to the playerNode whenever an impulse is applied to the physicsBody .
Note I will cover only the properties that I will be using in the SuperSpaceMan
game. If you want to see the complete list of properties, check out the Apple
Developer docs at https://developer.apple.com/library/ios/
documentation/SpriteKit/Reference/SKEmitterNode_Ref/
index.html and https://developer.apple.com/library/ios/
documentation/IDEs/Conceptual/xcode_guide-
particle_emitter/Introduction/Introduction.html .
What Are Emitters?
Particle emitters are a really cool and easy-to-use feature provided by Sprite Kit. You can
use them to create special effects that simulate anything from fire to rain. Sprite Kit imple-
ments these effects using the class SKEmitterNode .
An SKEmitterNode object is a node that creates and renders small particle sprites.
These sprites are owned by Sprite Kit and are not directly accessible by your game. You
Search WWH ::




Custom Search