Game Development Reference
In-Depth Information
slightly to the left of the particle node's position, so they perform a counterclockwise
radial movement.
Emitter Mode: Radius
Radius mode causes particles to rotate in a circle. It also allows you to create spiral ef-
fects with particles either rushing inward or rotating outward. You set radius mode with
this line:
self.emitterMode = kCCParticleModeRadius;
Like gravity mode, radius mode has exclusive properties. The following properties can
be used only when emitterMode is set to kCCParticleModeRadius :
self.startRadius = 100;
self.startRadiusVar = 0;
self.endRadius = 10;
self.endRadiusVar = 0;
self.rotatePerSecond = −180;
self.rotatePerSecondVar = 0;
The startRadius property determines how far away from the particle effect node's
position the particles will be emitted. Likewise, endRadius determines the distance
from the node's position the particles will rotate toward. If you want to achieve a per-
fect circle effect, you can set endRadius to the same as the startRadius using
this constant:
self.endRadius = kCCParticleStartRadiusEqualToEndRadius;
Using the rotatePerSecond property, you can influence the direction the particles
move and the speed with which they move, and thus the number of times they rotate
around if startRadius and endRadius are different.
The same particle effect that was shown in Figure 9-4 using gravity mode is shown in
Figure 9-5 using radius mode, and you'll notice how different it looks, despite all other
properties—except for the exclusive ones—being the same. To test this, uncomment
the following line in the ParticleEffects01 project:
Search Nedrilad ::

Custom Search