Creating the particle effect
Sprite Kit provides properties and variables to customize particle effects as per their requirement in a game. Let's discuss these properties and variables:
var particleBirthRate
: In this property, you define the number of particles created by the emitter every second. The default value of this is0.0
.func advanceSimulationTime( sec:NSTimeInterval )
: This method helps you advance the emitter particle simulation. It takes time in seconds as its parameter, which is the time required to simulate. Preferably, this method is used to preoccupy an emitter node with particles after its addition to scene.var numParticlesToEmit
: In this property, you define the number of particles the emitter has to emit. By default, its value is0
, which means that the emitter creates infinite particles.func resetSimulation ()
: This method removes all the particles and restarts the simulation. Resetting the simulation clears its internal state.var targetNode
: As discussed earlier...