The only task of this class will be to create a new emitter and add it to the emitter list of our game
class:
SpawnEmitter
to the game
class. Its parameters are the position, a time factor, and the kind
flag.Method SpawnEmitter:Int (x:Float,y:Float,t:Float,k:Int=0)
ParticleEmitter
class to the emitterList
. Then, close this method:emitterList.AddLast(New ParticleEmitter(x,y,t,k)) Return 0 End
Now, we are able to create emitters whenever and wherever we want. They will spit out particles for as long as we tell them to. Updating the emitters will be done inside the heart of our game, the engine
class.
When you spawn particles later in the game, they will look like the following screenshot:
18.188.218.157