I have been working on a simple game where players enter a username alongside 0 points and it is saved to a text file. Then, once the player completes the level they enter their username and their points are updated in the text file. Then, the players are sorted using their scores and the leaderboard is outputted.
However, I have realised that the text files only update once the game is closed and then reopened again so I cannot update the text file while the game is run.
Any ideas for how I could implement this so the data is changed while the game runs?