[Kde-games-devel] Help about a new game

Parker Coates parker.coates at gmail.com
Thu May 14 21:36:43 CEST 2009


On Thu, May 14, 2009 at 2:25 PM, Vincent Dupont wrote:
> It's almost that, but in my case a smaller score is better, and I get :
>
> Name Time Score
> A       4       2
> B       5       4
> C       3       4
>
> Instead of :
>
> Name Time Score
> A       4       2
> B       3       4
> C       5       4

KScoreDialog only sorts based on score. If two entries have the same
score, then the older one is considered better.

If you wish to have more complicated sorting in your game, then
calculate a score that includes the other parameters you wish to sort
on. So for the example above,

score = points * 10000 + time

So you get:

Name Score Points Time
A    20004 2      4
B    40003 4      3
C    40005 4      5

Then just hide the "Score" column in the dialog to avoid confusing
your users. I hope that makes sense.

Parker


More information about the kde-games-devel mailing list