public void addHighscore(Score sc) { highScores.Add(sc); highScores = highScores.OrderByDescending(x => x.score).ToList(); if (highScores.Count > 5) highScores.RemoveAt(5); }
public highScore() { leadingBoard=new Score[10]; for (int i = 0; i < 10;++i ) leadingBoard[i] = new Score(); leadingBoard[0].setScore("Mr.333",33333); leadingBoard[1].setScore("Gau Gau",14000); leadingBoard[2].setScore("Berserk",13000); leadingBoard[3].setScore("Sam",12000); leadingBoard[4].setScore("Rose",11000); leadingBoard[5].setScore("Sword",10000); leadingBoard[6].setScore("Guts",9000); leadingBoard[7].setScore("Destroyer",8000); leadingBoard[8].setScore("Ashes",7500); leadingBoard[9].setScore("Fracture",6500); }
private void EndGame() { MessageBox.Show("Game Over !!!"); foreach (Enemy enemy in Enemies) { TheForm.GetControls().Remove(enemy); } TheForm.menuForm.Show(); TheForm.Hide(); // Form1 fm = new Form1(); DialogResult result = fm.ShowDialog(); if (result == DialogResult.OK) { string x = fm.playerName; Score sc = new Score(x, TheForm.currentScore); TheForm.menuForm.addScore(sc); MessageBox.Show(TheForm.menuForm.high.ToString()); } }
public void addScore(Score sc) { if(sc != null) high.addHighscore(sc); BinarySerializeScores(high); }