private void CarSpawn_Tick(object sender, EventArgs e) { stage.addCar(rnd.Next(4), rnd.Next(8)); if (stage.checkJam()) { NextMove.Stop(); CarSpawn.Stop(); ManSpawn.Stop(); GameOver go = new GameOver(defOptions, "TRAFFIC JAM"); go.StartPosition = FormStartPosition.CenterScreen; go.ShowDialog(); if (go.nova == true) { stage = new Stage(defOptions); NextMove.Start(); CarSpawn.Start(); ManSpawn.Start(); Invalidate(); } else { this.Close(); } } }
private void Delay_Tick(object sender, EventArgs e) { Delay.Stop(); GameOver go = new GameOver(defOptions, "COLLISION"); go.StartPosition = FormStartPosition.CenterScreen; go.ShowDialog(); if (go.nova == true) { stage = new Stage(defOptions); NextMove.Start(); CarSpawn.Start(); ManSpawn.Start(); bgSound.Play(); Invalidate(); } else { this.Close(); } }