Time for action – destroying enemies
Add
checkShotEnemyImpacts()
andcheckRocketSplashDamage()
to the Collision Detection region of the WeaponManager class:private static void checkShotEnemyImpacts(Sprite shot) { if (shot.Expired) { return; } foreach (Enemy enemy in EnemyManager.Enemies) { if (!enemy.Destroyed) { if (shot.IsCircleColliding( enemy.EnemyBase.WorldCenter, enemy.EnemyBase.CollisionRadius)) { shot.Expired = true; enemy.Destroyed = true; if (shot.Frame == 0) { EffectsManager.AddExplosion( enemy.EnemyBase.WorldCenter, enemy.EnemyBase.Velocity / 30); } else { if (shot.Frame == 1) { createLargeExplosion(shot.WorldCenter); ...