public void IfYouWin() { if (Road.Auto.Location.Y > Road.Road.Location.Y - Road.Auto.Height) { Road.Auto.Top -= (int)StaticValues.carStep; } else { FinishGame.Stop(); FrmEndGame endGame = new FrmEndGame(FormGame, MenuForm, "WINNER", Road.PointQuantity, Crash); FormGame.Enabled = false; endGame.Show(); } }
public void GameTime() { if (Road.Ticks > 0) { Road.Ticks--; Road.Time.Text = "Time: " + Road.Ticks.ToString(); } else { Road.Ticks = 0; Road.Time.Text = "Time: " + Road.Ticks.ToString(); SceneTimer.Enabled = false; GameTimer.Enabled = false; FrmEndGame endGame = new FrmEndGame(FormGame, MenuForm, "TIMEOUT", Road.PointQuantity, Crash, "Try Again"); FormGame.Enabled = false; endGame.Show(); } }