How to record the High score of the game, must use database :,{ ?

I wish to record the high score of the game player, can anyone tell me how can i make it I think i can not use only the variables to make it, because all the data will lost after i closed the game. If really need to use database, then can anyone give me some link of free tutorial.

Thanks




Answer this question

How to record the High score of the game, must use database :,{ ?

  • penninha

    A database would be overkill for just a high score being stored on local computer. You can just save it to an XML file in your game folder if you just want a simple solution. Encrypt the file or the text however you want to if you do not want the user messing with it.

    So you do not need a database for saving a high score for a game being play locally.

    However if you are needing a central location to store all of the high scores for all the players all over the world playing your game. Then a database is going to be your better option. I found this awesome link of articles and information about doing that if that's what you need to do.

    Hope that helps.




  • zdrae

    hi,

    Thank you for your's reply. Actualy i'm thinking to do two high score, 1 is for tournament another is for single game. For the tournament, that mean every games the user played will be count the scores. For example, their new result can get full score, last 2nd until 10th games count 0.5, last 11th until 20th games count 0.2, the game over 20th will not counted any score.

    For example, kenneth is a player of this game.

    his latest score is --> 23 * 1 = 23

    2nd --> 22 * 0.5 = 11

    3rd --> 31 * 0.5 = 15.5

    4th --> 19 * 0.5 = 14.5

    5th --> 17 * 0.5 = 13.5

    6th -->22 * 0.5 = 11

    7th --> 20 * 0.5 = 10

    8th --> 14 * 0.5 = 7

    9th --> 15 * 0.5 = 7.5

    10th --> 18 * 0.5 = 9

    11th --> 20 * 0.2 = 4

    12th --> 14 * 0.2 = 2.8

    13th --> 15 * 0.2 = 3

    14th --> 15 * 0.2 = 3

    15th --> 18 * 0.2 = 3.6

    16th --> 20 * 0.2 = 4

    17th --> 14 * 0.2 = 2.8

    18th --> 15 * 0.2 = 3

    19th --> 15 * 0.2 = 3

    20th --> 18 * 0.2 = 3.6

    21th --> 20 = no score(result expired)

    22th --> 14 = no score(result expired)

    The total tournament scores (from latest game to game 20th, game over 20th will not calculate) for player Kenneth is 154.8.

    I think each row of record also need 20 fields to record the score from latest game to 20th game score. 1 field for the final total score, and 1 field for the user name. When a new game start, all the games scores will be updated, the value for latest score field will be assigned to second score field, second to third.........

    In situation usind database is better, or XML

    which one is better. Sorry, because i'm only a first year student,,... so a lot of thing also not very clear.



  • How to record the High score of the game, must use database :,{ ?