//Restart resets the BaseModel, ready for a new game to begin. public virtual void Restart() { music.Stop(); UnsubscribeAll(); spawner = null; living.Clear(); dying.Clear(); dead.Clear(); bullets.Clear(); usedBullets.Clear(); deathRow.Clear(); turrets.Clear(); players = new MainGun[4] { new MainGun(0), new MainGun(1), new MainGun(2), new MainGun(3) }; tower = new Tower(); // Free up memory - we've chucked a lot of stuff away and there shouldn't be much processing going on right now. System.GC.Collect(); }
void GameOver(object sender, EventArgs e) { // Stop sending click/beat/bar effects - music may still be playing though (e.g. outro). Music.Stop(); }