Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The method to emit explosion particles works in a similar way to the one that emits smoke.
SpawnExplosion in the game class. The parameters are the x and y positions, and the amount of particles to create.Method SpawnExplosion:Int(x:Float, y:Float, amount:Int)
eng.SetDefaultLayer(layerGame)
i variable ranging from 1 to the amount parameter of the method.For Local i:Int = 1 To amount
x offset that is used when an image object for the explosion particle is created.Local xoff:Float = Int(Rnd(0,3))
Local obj:=eng.CreateImage(atlas,144+xoff*16.0,80,16,16, x,y)