Game Development Reference
In-Depth Information
Now you will see the Emitter Node properties. Many of them are cryptic, but try
playing with them and you will see that they are not that scary. Let's discuss some
of them:
Birthrate : This is the rate at which the emitter generates particles. The greater
the number here, the more intense the effect feels. Try to keep this as low as
possible to achieve the same effect for a good frame rate.
Lifetime : This defines how long a particle will live. This indirectly affects
how far away the particles will fly from the emitter. Range here means that
the emitter will use a random value from the first value +- range.
Position Range : This defines how far from the center of SKEmitterNode
the particles will appear. In practice, this affects how big you want your
emitter to be.
Angle : This is the direction in which the particles will fly.
Speed : This is the starting speed of the particle, with the same range
variance as in the previous properties.
Acceleration : This value on x and y axes means where the particles will fly
as soon as they appear.
Alpha : This makes the particles transparent and sets the value and range to
your liking.
Scale : This is the size of the texture used for the effect. Sometimes you will
want smaller particles and sometimes you will want bigger ones, and this
property allows you to have only one texture for both of them.
Rotation : This is rarely needed, as each particle lives for so little time that
usually rotation is meaningless.
Color Blend : This is one of the most interesting properties. It allows you to
set color change in particle life. Particles can start at one color and slowly
arrive to another color.
Set particle effect properties to those shown in the preceding screenshot. This will
create a nice jet of flame that looks useful to our game. The next thing that we need
to do is add it to our player character.
In order to do that, add a new property to ERGPlayer.h :
@property (strong, nonatomic) SKEmitterNode *engineEmitter;
 
Search WWH ::




Custom Search