Hello,
I'm working on my first project and I have a problem with my highscore tables.
The game is a remake of space taxi where players have to pick up and deliver clients. The score is the number of clients delivered. But players can choose the amount of playing time (60, 120, 180 seconds).
So I need to incorporate the time in the table, because obviously delivering 5 clients in 60 seconds is better then 5 clients in 180 seconds.
Sofar I can only sort on the score but for equal scores I would need second sort on the time, ie:
rank name clients time
1. aaa 5 60
2. bbb 5 120
3. ccc 5 180
4. ddd 3 120
5. eee 3 180
etc.
I hope I'm clear enough and that someone can help :)
Here is the function I'm using:
Function SortHighscores(sPlayer$,iScore%,iOption%)
For i = 0 To iTableSize% - 1
If iScore% >= HSClients(i)
sTempName$ = HSName$(i)
iTempScore% = HSClients(i) iTempOption% = HSTime(i) HSName$(i) = sPlayer$ HSClients(i) = iScore% HSTime(i) = iOption% sPlayer$ = sTempName$
iScore% = iTempScore%
iOption% = iTempOption%
End If
Next
End Function
Thanks!
Klaus
I'm working on my first project and I have a problem with my highscore tables.
The game is a remake of space taxi where players have to pick up and deliver clients. The score is the number of clients delivered. But players can choose the amount of playing time (60, 120, 180 seconds).
So I need to incorporate the time in the table, because obviously delivering 5 clients in 60 seconds is better then 5 clients in 180 seconds.
Sofar I can only sort on the score but for equal scores I would need second sort on the time, ie:
rank name clients time
1. aaa 5 60
2. bbb 5 120
3. ccc 5 180
4. ddd 3 120
5. eee 3 180
etc.
I hope I'm clear enough and that someone can help :)
Here is the function I'm using:
Function SortHighscores(sPlayer$,iScore%,iOption%)
For i = 0 To iTableSize% - 1
If iScore% >= HSClients(i)
sTempName$ = HSName$(i)
iTempScore% = HSClients(i) iTempOption% = HSTime(i) HSName$(i) = sPlayer$ HSClients(i) = iScore% HSTime(i) = iOption% sPlayer$ = sTempName$
iScore% = iTempScore%
iOption% = iTempOption%
End If
Next
End Function
Thanks!
Klaus