Hello,
i have a simple pong game.
i inserted a counting which does +1 when the ball hits the paddle. and i show this on screen. this works
i also already have code that exits the game when the ball misses the paddle
But now i want to save highscore.
This is precisely what i want:
- when game is over, save highscore
- only overwrite it when it's higher than the previous
- load it when game starts
just very simple, only a number. No table or best 10 or something, just 1 number that only overwrites when its higher the the previous.
thanks in advance
Rick
Loading

Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 26, 2011, 1:09 PM EDT
Rick van Leeuwen37 reputationPosted Oct 26, 2011, 1:10 PM EDT
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 26, 2011, 1:22 PM EDT
1. Right Click on the project, click properties.
2. Click on Settings tab on the left, this will open grid on the right hand side. Here you need to enter name of the setting (topscore), type(string), scope(User) and Value(0).
3. you can later access this settings from C# code like below.
Properties.Settings.Default.topscore;
you can save new score to this setting like below:
Properties.Settings.Default.topscore= mtopScore;
Properties.Settings.Default.Save();
Rick van Leeuwen37 reputationPosted Oct 26, 2011, 1:34 PM EDT
or am i looking in the wrong window?
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 26, 2011, 4:43 PM EDT
Rick van Leeuwen37 reputationPosted Oct 29, 2011, 2:10 PM EDT
i just need simple instructions:
- make the XML
- save a variable to the XML
- load variable form XML
Thanks
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 29, 2011, 4:37 PM EDT
http://xnaessentials.com/tutorials/highscores.aspx/tutorials/highscores.aspx