Time for action – updating and drawing explosions
Add the
Update()
method to theExplosionManager
class:Public Sub Update(gameTime As GameTime) For x As Integer = ExplosionParticles.Count-1 to 0 Step -1 If (ExplosionParticles(x).IsActive) Then ExplosionParticles(x).Update(gameTime) Else ExplosionParticles.RemoveAt(x) End If Next End Sub
Add the
Draw()
method to theExplosionManager
class:Add an instance of the
ExplosionManager
to the declarations area of theGame1.vb
class file:Private _explosionManager As ExplosionManager
Still in the
Game1
class, add the initialization of the_explosionManager
object to theLoadContent()
method:_explosionManager = new ExplosionManager( spriteSheet, new Rectangle(0, 100, 50, 50), 3, new Rectangle(0, 450, 2, 2))
In the
Update()
method ofGame1
, add a line to update theExplosionManager
, after theEnemyManager
has been updated:_explosionManager.Update(gameTime)
In the
Draw()
method of the...