Time for action – new weapons
Add the following declarations to the
WeaponManager
module:Public Enum WeaponType Normal Triple Rocket End Enum Public CurrentWeaponType As WeaponType = WeaponType.Triple Public WeaponTimeRemaining As Single = 30 private _weaponTimeDefault As Single = 30 Private _rocketMinTimer As Single = 0.5 Private _tripleWeaponSplitAngle As Single = 15
Replace the current
WeaponFireDelay
property with the following:Public ReadOnly Property WeaponFireDelay As Single Get If CurrentWeaponType = WeaponType.Rocket Then Return _rocketMinTimer Else Return _shotMinTimer End If End Get End Property
Replace the current
FireWeapon()
method with the following:Public Sub FireWeapon(location As Vector2, velocity As Vector2) Select Case CurrentWeaponType Case WeaponType.Normal AddShot(location, velocity, 0) Case WeaponType.Triple AddShot(location, velocity, 0) Dim...