|
-
Dec 12th, 2005, 06:01 AM
#1
Thread Starter
Junior Member
How To Save And Modify A 'high Score'?
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
-
Dec 12th, 2005, 07:38 AM
#2
Re: How To Save And Modify A 'high Score'?
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
-
Dec 12th, 2005, 09:44 AM
#3
Thread Starter
Junior Member
Re: How To Save And Modify A 'high Score'?
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.
-
Dec 12th, 2005, 09:46 AM
#4
Re: How To Save And Modify A 'high Score'?
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?
-
Dec 12th, 2005, 09:52 AM
#5
Thread Starter
Junior Member
Re: How To Save And Modify A 'high Score'?
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!
Last edited by nick_roberts; Dec 12th, 2005 at 10:08 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|