To implement explosions follow the ensuing steps:
1. Create a new script and save it under the name
explosionClass.monkey
.2. Again, switch into
Strict
mode, importgameClasses
, and create a global list calledexplosions
, to store each explosion created in it.Strict Import gameClasses Global explosions := New List<explosion>
Just like with the other objects before, we need some wrapper functions, which we can implement into the
RocketCommander
class. Only the names of the functions are different, so you already now how they work.3. Implement functions to create, update, render, and remove explosions.
Function UpdateExplosions:Int() For Local explosion := Eachin explosions explosion.Update() Next Return True End Function RenderExplosions:Int() For Local explosion := Eachin explosions explosion.Render() Next Return True End Function RemoveExplosions:Int() explosions.Clear() Return True End Function CreateExplosion:Int(x:Float, y:Float) Local...