bool HasCollided(Missile r) { for (int i = 0; i < EnemyManager.Enemies.Count; i++) { if (r.MissileTargetIndex == EnemyManager.Enemies[i].Index) { if (r.BoundingRect.Intersects(EnemyManager.Enemies[i].BoundingRect)) return true; } } return false; }
public static void LaunchMissiles(Vector2 position, ProjectileOwner owner) { foreach(int i in enemyIndexes) { Missile r = new Missile(rocketTex, position, rocketTex.Width, Color.White, 0.0f, 1.0f, drawLayer, 0, i, ProjectileType.Missile, new Vector2(1, 0), rocketSpeed, owner); projectiles.Add(r); } enemyIndexes.Clear(); }