Help with hiscore table.

This forum is currently in read-only mode.
  • Greetings everybody!

    I couldn't find the information i want, so here is my first post.

    I want to make a hiscore table for my game. An offline hiscore table that you can save it and auto load it every time you run the game. Your five best scores i want to be displayed so i need also a way to make construct understand if your current score is big enough to go to the hiscore table.

    So please can anybody help me with this?

    Thank you in advance.

  • You could use an array to store the scores. Then just use a loop to check each element in the array with the current score to see if it belongs in the high score table. You could sort the array as well.

    To store the array you could use the .ini object to save the results out to and to load the results from.

  • What scidave said isn't probably the worst idea.

    Still I have a little cap for you using the List Box object. It's similar to an example I did for an online highscore using a flatfile. Click the blue square to get some points, enter your name and submit your score. Every time you submit a score the highscore will be saved to a file. Pretty simple and it's probably better to go the array/hashtable way somehow. Anyway I thought I'd share.

    Highscore example: Download

  • Thank you for your help, but my problem is something else now, 2 days am trying to fix this and is stll there. I want something very simple, save your highscore when you die or finish the game and load it when you run the game. Your highest score, not your score... so i make it like this...

    Is global variable "score" Greater than global('hiscore')

    then

    System: Set global variable 'hiscore' to global('score')

    i made an .ini file that looks like this...

    [hiscore]

    score=0

    in order to save/load the #$% highscore, so at the same moment follows...

    INI:Write value global('hiscore') to item "score" in group "hiscore"

    so far so good i can write in the ini file with the value i want, now to load it every time you run the game i made this...

    Start of layout

    System: Set global variable 'hiscore' to INI .ItemString("hiscore", "score")

    and is working too, i can load the value from the ini file, but is not working together!!! I can save a value to the ini, i can load a value from the ini but when in my game the save and load action is together is not working, it loads the value but it can not save any new value later. Is like i have the load value action under an Always event and you cant change it.

    Almost the only thing remains to finish my game is this.

    My english is not very good, i hope you understand my problem. If more information is need it please let me know.

    Thenk you all for your time and for your brain activity to solve my problem

  • and is working too, i can load the value from the ini file, but is not working together!!! I can save a value to the ini, i can load a value from the ini but when in my game the save and load action is together is not working, it loads the value but it can not save any new value later. Is like i have the load value action under an Always event and you cant change it.

    I'd love to help you out there, but I can't say I do really follow. Maybe if you shared the cap, things would be easier.

  • has anyone posted a .cap example for online highscores? or an explanation?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • has anyone posted a .cap example for online highscores? or an explanation?

    I believe there was an older thread describing how to do it with php/mysql. Without a cap example though. I did an example simply using a flatfile (and php), but didn't share the source yet. Mainly because I wanted to set it up as some sort of tutorial, but didn't come around to do so. If you're interested in a flatfile example, I could probably help you out.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)