//Updates and calls DeleteBullets for all bullets blastwave private static void ManageBullets(GameTime time) { int loopControl = bullets.Count; for (int i = 0; i < loopControl; i++) { CollisionGrid.Commit(bullets[i]); bullets[i].Update(time); } loopControl = growers.Count; for (int i = 0; i < loopControl; i++) { growers[i].Update(time); } DeleteBullets(bullets, false); DeleteBullets(growers, true); for (int i = 0; i < blasts.Count; i++) { if (blasts[i].HalfDead) { blasts.RemoveAt(i); } } }
public virtual void Update(bool trigger, float time) { CollisionGrid.Commit((Enemy)this); ScreenWrap(); IsDead = CheckDeath(); Behave(trigger, time); position += velocity; }
public override void Update(bool trigger, float time) { if (!FirstInChain) { CollisionGrid.Commit((Enemy)this); } else { CollisionLocation.X = position.X + (float)Math.Cos(angle) * Size; CollisionLocation.Y = position.Y + (float)Math.Sin(angle) * Size; } ScreenWrap(); IsDead = CheckDeath(); Behave(trigger, time); position += velocity; if (Child != null) { Child.Update(trigger, time); } }