Save only best scores? Capx. included.

0 favourites
  • 12 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • I`ve asked on the forum few times and no real answer. I want to save only best scores, in my case shorter time, better score.

    I tried many different ways to solve this problem, think i am quite close now, but i miss something.

    I add this capx. so you can help me and in some way i`ll help you if you need my idea on how to make flying helicopter, control with W,A,S and D.

    dl.dropbox.com/u/67937942/heli.capx

    Help pls... i have 3 finished games waiting only scores to be added all on the same base.

  • Is this version with or without your try at a highscore system?

  • There is a highscore, but need to be fixed, only to save best scores.

  • I don't have time right now to look over your project, but here's how to do it!

    Create 2 global variables,

    SCORE

    BESTSCORE

    when you run your game you will operate with the score(init with 0), and at the end of the game, compare score with bestscore, if score > bestscore then bestscore = score

  • Ok, the things you need to do/fix:

    In eventsheet[GAME] Event#8:

    The system will always check after this value and therefore when "Timelim" starts at 0 the system will see that and record it as "StoredScore".

    You will need another variable that tells the game if the game is still going on. This can be called "Ingame".

    That means Event#8 should look like:

    <img src="http://i46.tinypic.com/2uigakm.png" border="0" />

    Remember when the game ends you need "Ingame=0"

    In eventsheet[MENU] Event#2:

    Add a Set "Savescore" to 0

    You will also need the savedscore to be something like "9999999" so it will always save the score from the first go.

    (When "savedscore" starts at 0 it wont move because <="savedscore" is already written as [Less or Equal to 0])

    Might be hard to understand, but if you dont, just ask. (Began with construct 4days ago)

  • If you can change the capx. it will be great. My brain can`t understand saving with construct 2...

  • Ill do, just give me a couple of minutes and ill update this post.

  • Ok, no problem

  • dropbox.com/s/hvkgz63g1wiixjz/heli.capx

    Link to the file, with highscores (Changed some of the names used)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so i press play, finish the lvl in 7 seconds. In menu it says Score: 7, Highscore: 0, than i close the browser, and start the game from the beginning, finish the game in 9 seconds and in menu it shows Score: 9, Highscore: 0, i don`t see the problem solved here :), btw if you start directly in menu it shows Score:0, Hiscore: 0, so nothing is saved.

    Create 2 global variables,

    SCORE

    BESTSCORE

    when you run your game you will operate with the score(init with 0), and at the end of the game, compare score with bestscore, if score > bestscore then bestscore = score

    i`ve tried this few months ago, but no result, maybe i missed something, if you think you can do it, pls fix the capx.

  • WebStorage here by refered to as WS

    Endgame event(however you judge it)

    WS set localvalue "HighScore" =

    WS.localValue("HighScore") < currentHighScore ? currentHighScore : WS.localValue("HighScore")

    onLoad of layout or retrieving Highscore

    set currentHighScore = WS.localValue("HighScore")

  • I finally did it, thanks to "wildmedia" idea.

    dl.dropbox.com/u/67937942/save%20best%20score.capx

    btw best way to help someone is with capx, cause until you try it you can`t be certain it will work.

    Thanks to all, problem is solved.

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