How do I make a High Score table?
Author |
Message |
born130
![](http://www.battle.net/war3/ladder/portraits/animated/w3xp/W3o5.gif)
|
Posted: Fri Jun 06, 2003 4:00 pm Post subject: How do I make a High Score table? |
|
|
Hello,
I wanted to know how I could make a high score table in my game.
For example if the user breaks the record say 9.68 seconds, it will "save" this number as the new record to beat. Just like an arcade game.
Some people say i should use a text file?
Any help is appreciated.
thanks |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
hello
|
Posted: Fri Jun 06, 2003 4:13 pm Post subject: (No subject) |
|
|
u should use a textfile to store the scores or times
then when u get a new time or score
check if the tenth score or time in the textfile is smaller or greater then the inputed one
and if its watever (greater or smaller)
then replace the tenth score with the inputted score
and then
start check in a decreasing loop
if the ninth score is watever to the inputed one that is tenth
and if watever switch them |
|
|
|
|
![](images/spacer.gif) |
born130
![](http://www.battle.net/war3/ladder/portraits/animated/w3xp/W3o5.gif)
|
Posted: Fri Jun 06, 2003 4:15 pm Post subject: (No subject) |
|
|
show example |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Fri Jun 06, 2003 7:06 pm Post subject: (No subject) |
|
|
open : fileName, fileNum : get
get fileNum, tempValue
if scrore > tempValue then
open : fileName, fileNum2 : put
put fileNum, score
end if
/\ something like that... I'm not sure of the syntax though, didnt use that in a long time |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
JSBN
![](http://genesis.thruhere.net/site/templates/fisubsilversh/images/news/avatarS.gif)
|
Posted: Fri Jun 06, 2003 7:50 pm Post subject: (No subject) |
|
|
code: |
var filenum,score,highscore : int
open: filenum,"Highscores.txt" get
get: filenum, highscore
close : filenum
if score > highscore then
open: filenum,"Highscores.txt" put
put: filenum, score
close : filenum
end if
|
That should be what you are looking for. |
|
|
|
|
![](images/spacer.gif) |
naoki
![](http://members.lycos.co.uk/switch01/raidenex.bmp)
|
Posted: Fri Jun 06, 2003 7:56 pm Post subject: (No subject) |
|
|
make 2 arrays : 1 to hold the name, 1 to hold the score
loop and read all the names and scores from a textfile, storing them into the array
afterwards loop again and see if the new score beats any of'em. if it does then delete last score and name and move every entry down 1, putting new score in its appropriate place
then loop again and write it all into the textfile. |
|
|
|
|
![](images/spacer.gif) |
Andy
|
Posted: Fri Jun 06, 2003 9:23 pm Post subject: (No subject) |
|
|
born130, you know you can just call me and ask me or ask me at school eh? instead of having hang helping you... jk |
|
|
|
|
![](images/spacer.gif) |
|
|