I have been using external txt files to save the score and the player name (I only save one score and one name in two different files)
When there is a new highscore it saves over the old one. I had it all working perfectly until I published the project, now it cant locate the file.
I embedded the txt file but I cant write to it.
I am using the following code.
using (StreamWriter write = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "highscore.txt")) // read the high score text file
{
write.WriteLine(player.score); // saves the new high score
write.Close(); // closes the file
}
using (StreamWriter write = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "nickname.txt")) // reads the high score text file
{
write.WriteLine(player.nickname); // save new highscore name
write.Close(); // close file
}
When I run the games from a USB or a CD they wont read -
So my question is - how to I place the txt files into a directory my game can see/find?