Time for action – spark effects
Add the
AddSparkEffect()
method to the Public Methods region of theEffectsManager
module:Public Sub AddSparksEffect( location As Vector2, impactVelocity As Vector2) Dim particleCount As Integer = _rand.Next(10, 20) For x As Integer = 1 To particleCount Dim spark As Particle = New Particle( location - (impactVelocity / 60), _texture, _ParticleFrame, randomDirection(CSng(_rand.Next(10, 20))), Vector2.Zero, 60, 20, Color.Yellow, Color.Orange) _effects.Add(spark) Next End Sub
In the
LoadContent()
method of theGame1
class, initializeEffectsManager
after thePlayer
has been initialized:EffectsManager.Initialize( spriteSheet, New Rectangle(0, 288, 2, 2), New Rectangle(0, 256, 32, 32), 3)
In the
Update()
method of theGame1
class, updateEffectsManager
after thePlayer
has been updated:EffectsManager.Update...