public void Update(GameTime gameTime) { EnemyShotManager.Update(gameTime); for (int x = Enemies.Count - 1; x >= 0; x--) { Enemies[x].Update(gameTime); if (Enemies[x].IsActive() == false) { Enemies.RemoveAt(x); } else { if ((float)rand.Next(0, 1000) / 10 <= shipsShotChance) { Vector2 fireLoc = Enemies[x].EnemySprite.Position; fireLoc += Enemies[x].gunOffset; Vector2 ShotDirection = playerManager.Position - fireLoc; ShotDirection.Normalize(); EnemyShotManager.FireShot(fireLoc, ShotDirection, false); } } } if (Active) { updateWaveSpawns(gameTime); } }
public void Update(GameTime gameTime) { PlayerShotManager.Update(gameTime); shotTimer += (float)gameTime.ElapsedGameTime.TotalSeconds; }