private void UpdateParticles() { foreach (Particle o in DeadParticles) { o.Die(this); Particles.Remove(o); } DeadParticles.Clear(); foreach (Particle o in NewParticles) { Particles.Add(o); } NewParticles.Clear(); }
// Crap, when must this happen? // It can happen whenever Objs is the current state... which is thoretically always. // This will nuke the particles though. // This is actually pretty close to correct. public void SetLevel(int level) { UpdateObjects(); Objs.Remove(Player); Levels[CurrentLevel].Objs = Objs; // This is PROBABLY right, but I'm not sure. CurrentLevel = level; Objs = Levels[CurrentLevel].Objs; Objs.Add(Player); NewObjs.Clear(); DeadObjs.Clear(); Particles.Clear(); NewParticles.Clear(); DeadParticles.Clear(); UpdateCollisionTree(); }