Game Development Reference
In-Depth Information
and then stop for 1 second and then emit another 20 particles. It will repeat this process
forever. When you have finished playing around with these two properties, change the
Birthrate property back to 2000 and the Maximum property back to 0.
The Start and Range Properties
The next two particle life-cycle properties are the Start and Range properties. These prop-
erties control the lifetime of the emitted particles. The Start property controls the average
length of time in seconds that a particle is visible. When the time elapses, the particle
fades away.
The Range property provides a method of varying the time a particle is on the screen.
When you set this property to any number other than 0, then a random number between 0
and the entered number is generated. Half of that number is then randomly added or sub-
tracted to the Start value to produce the final lifetime of the particle. If you enter 0, then
all particles will stay visible for the same amount of time.
The Particle Movement Properties
There are four sets of properties that affect the movement of particles being emitted, as
shown in Figure 6-7 and described in the following sections.
Figure 6-7 . The Sprite Kit particle movement properties
The Position Range Property
Search WWH ::




Custom Search