public void RemoveDeadSprites() { foreach (Sprite sprite in DeadSprites) { LevelSprites.Remove(sprite); Game1.Instance.CollisionHandler.AllElements.Remove(sprite); if (sprite is ICollidable) { Game1.Instance.CollisionHandler.CollisionListenersList.Remove((ICollidable)sprite); } } DeadSprites.Clear(); }
public void AddDeadSpriteToList(SpriteBase creature) { DeadSprites.Add(creature); }
public void MarkDead(Sprite sprite) { DeadSprites.Add(sprite); }