Leader board

There is now a leader board that updates with each game as long as the player inserts their name.

Insert player name at the top:

Leader board on the game over screen:

Code for the leader board:

string playerName = Game.player.playerName;
File.AppendAllLines(@"leaderboard.txt", new string[] { playerName + " " + Game.player.Score.ToString()}); 
string content = File.ReadAllText(@"leaderboard.txt");
ScoreBoardTextBox.Text = content;

The playerName is grabbed from the Game.player and a text file named leaderboard is made or if it exists then the players name followed by their score is appended to the txt file.

Last updated