# 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:

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FPmpCW0g8Fzv2kozcl3bn%2FExplore%2011_15_2023%201_37_28%20PM.png?alt=media&#x26;token=f83b6701-6448-4056-bb8a-eb82d2e7e175" alt=""><figcaption></figcaption></figure>

Leader board on the game over screen:\\

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FERwmwi7hcvIWpD3eJQdk%2FFrmGameOver%2011_15_2023%201_42_40%20PM.png?alt=media&#x26;token=44eb886a-d9b5-4f3f-840b-8234a7488afc" alt=""><figcaption></figcaption></figure>

Code for the leader board:

```csharp
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.
