I've created a game and would lke to be able to save the players high score. to help with the code the high score in my game would = 'offer'
I assume i would save the high score to a txt file? but have never done this before.
Nick
Printable View
I've created a game and would lke to be able to save the players high score. to help with the code the high score in my game would = 'offer'
I assume i would save the high score to a txt file? but have never done this before.
Nick
Not a lot of information to go on, so my response will be kind of general. To save something to a text file, use:VB Code:
Open "C:\Score.txt" For Append As #1 Print #1, What_you_use_to_store_the_score Close #1
Thanks Hack,
that'll get me started, but if i wanted to create a form that displayed 'top 10 scores'. How would i access the txt file and display the top 10 scores when the form is loaded?
let me know if there is any more info you need.
Tell me exactly how this text file is going to be structured.
I'm sure it will contain more than just a bunch of numbers.
How will you associate a number (score) with a name (of the person that scored it)?
Other than name and score, what else is going to be in there, and in what order?
example of saved 'top score' file:
£32,500 <tab> John
£5,000 <tab> Dave
£250,000 <tab> Mark
------------------------------------------
If it makes things eaiser, the score doesn't have to be saved as a £ value - just an int.
I will provide the user with an input box to input their name and their top score is calculated automatically at the end of the game (there is only ever 1 user at a time).
This is all i have decided at the moment, and its quite flexable if we need to change things!