// updates blasts and removes them from list when size reached public static void UpdateBlasts(GameTime gameTime) { for (int i = 0; i < Blasts.Count; i++) { Blast b = Blasts[i]; if (b.Update(gameTime)) { Blasts.Remove(b); i--; } } }
void updateBlasts(GameTime gameTime) { // add new blasts from queue for (int i = 0; i < ExplodingBullet.Explosions.Count;) { Vector2 explosionPoint = ExplodingBullet.Explosions[i]; Blast b = new Blast(explosionPoint, 15, 25); b.Texture = blastTexture; b.Rotation = MathHelper.TwoPi * (float)rand.NextDouble(); ExplodingBullet.Explosions.Remove(explosionPoint); } Blast.UpdateBlasts(gameTime); }
void updateBlasts(GameTime gameTime) { // add new blasts from queue for (int i = 0; i < ExplodingBullet.Explosions.Count; ) { Vector2 explosionPoint = ExplodingBullet.Explosions[i]; Blast b = new Blast(explosionPoint, 15, 25); b.Texture = blastTexture; b.Rotation = MathHelper.TwoPi * (float)rand.NextDouble(); ExplodingBullet.Explosions.Remove(explosionPoint); } Blast.UpdateBlasts(gameTime); }