Game Development Reference
In-Depth Information
//self.emitterMode = kCCParticleModeRadius;
Particle Position
By moving the node, you also move the effect. But the effect also has a posVar prop-
erty that determines the variance in the position where new particles will be created. By
default, both are at the center of the node:
self.position = CGPointZero;
self.posVar = CGPointZero;
A very important aspect of particle positions is whether existing particles should move
relative to the node's movement or whether they should not be influenced at all by the
node's position. For example, if you have a particle effect that creates stars around your
player-character's head, you'd want the stars to follow the player as he moves around.
You can achieve this effect by setting this property:
self.positionType = kCCPositionTypeGrouped;
On the other hand, if you want to set your player on fire and you want the particles to
create a trail-like effect as the player moves around, you should set the posi-
tionType property like this:
self.positionType = kCCPositionTypeFree;
The free movement is best used with steam, fire, engine exhaust smoke, and similar ef-
fects that move around with the object they are attached to and should give the impres-
sion of not being connected to the object that emits these particles.
Particle Size
The size of particles is given in pixels using the startSize and endSize proper-
ties, which determine the size of the particles when they're emitted and how big they
are when they're removed. The size of the particle gradually scales from startSize
to endSize .
self.startSize = 40.0f;
self.startSizeVar = 0.0f;
Search Nedrilad ::

Custom Search