private void btnHighScores_Click(object sender, EventArgs e) { HighScoresList form = new HighScoresList(info.highscores); form.ShowDialog(); }
private void gametimer_Tick(object sender, System.EventArgs e) { Form form; int position; Pause(); if (players == 1) { position = info.highscores.Check(player1.points); if (position > 10) { form = new NotHighScore(player1.points); form.ShowDialog(); } else { NewHighScore formnhs = new NewHighScore(player1.points, position); DialogResult result = formnhs.ShowDialog(); if (result == DialogResult.OK) { info.highscores.Add(player1.points, formnhs.name, position); } else { info.highscores.Add(player1.points, "Unnamed", position); } } form = new HighScoresList(info.highscores); } else if (players == 2) { if (player1.points > player2.points) { form = new Winner(1, player1.img1); } else if (player1.points < player2.points) { form = new Winner(2, player2.img1); } else { form = new Winner(0, logoimage); } } else { if (player1.points > player2.points && player1.points > player3.points) { form = new Winner(1, player1.img1); } else if (player2.points > player1.points && player2.points > player3.points) { form = new Winner(2, player2.img1); } else if (player3.points > player1.points && player3.points > player2.points) { form = new Winner(3, player3.img1); } else { form = new Winner(0, logoimage); } } form.ShowDialog(); Pause(); EndGame(); }