To modify the
rocket class, we will follow the ensuing steps:
Updatemethod and add a
CreateExplosioncall there. The parameters are the current X and Y positions of the rocket.
If cy < ty Then CreateExplosion(Self.cx, Selfish) rockets.Remove(Self) Endif
We have modified the
rocket class to create a new explosion once the rocket reaches its target position.
An explosion will grow in size over time, before it disappears. For this, we have created a function called