Game Development Reference
In-Depth Information
How it works
Whenever a SpriteKit particle file is created, a default image that is imported, such as
spark.png, is used as a particle in that particle system. We can also import any image of
ours externally to make a personalized particle system.
As depicted earlier in the making of the thrust of the spaceship, we changed some values of
the FireParticle file to have a fire thrust:
• We changed the angle value to 180 so that the direction of the thrust can be correct
as per the spaceship that is, it moves right to left
• We reduced the lifetime and birthrate to match the capacity of the spaceship so that
it can emit as per its size
• We also changed the initial size of the particles to match the machinery by which
the thrust is released
• We tweaked the speed, alpha, and so on
As depicted earlier in the making of the collision effect, we changed some values of the
SmokeParticle file to have a smoke effect:
• To make it white, we changed Color Blend to 0
• To make it disappear fast, change LifeTime to 2 and Speed to 20
• To reduce the intensity of particles, assign the number of Particles to 20, and to
play it once, assign maximum particles to 1
• Set the angle to 0 and scale to 0.2 to make the smoke move subtile from left to
right
So it's all on us how we want the emitter particle system to behave, to be put, and build ac-
cording to that.
Talking about the class that helps to add this particle system that is, SKEmitterNode ,
which is used to add the particle system in the game by a file or in the code itself. Both op-
tions we would be doing at the code level in the upcoming section.
Search WWH ::




Custom Search