[WebStorage] saving high score Locally...

0 favourites
  • 3 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • I am needing to save the "High Score" text to save on Chrome and an Android app, so when a player starts the game back up, he will still have his previous High Score.

    I have tried numerous techniques with WebStorage, but just cannot seem to get it to work correctly.

    I understand that I need to save the Global Variable "HighScore" locally, but I can't seem to figure it out.

    I have read and watched all the tutorials I can find. Most of the WebStorage tutorials save different things, but not the high score, and the ones that do show the high score being saved, show it being done with a "top 10 high score" using an array and WebStorage. I am not needing to do that. PLEASE HELP!!! I am a noob at construct but I am loving the learning curve!

    I am using three layouts: Start, Game, Game Over. I am only needing the high score to appear on the Game Over layout.

    Here is my Global Variables for score and what-not:

    [attachment=0:1uyfichb][/attachment:1uyfichb]

    Here is my Event Sheet for my Game Over Layout:

    [attachment=1:1uyfichb][/attachment:1uyfichb]

    And here is a simple screenie of the Game Over layout being tested in my browser"

    [attachment=2:1uyfichb][/attachment:1uyfichb]

    Thanks in advance, and if you have tips to offer me, please keep in mind that I am learning and don't understand too much.

  • Here is an example capx i made for you.

    https://dl.dropboxusercontent.com/u/108480585/webstorage.capx

    It works as follows.

    If there is already a "local key" called "my_games_highscore" it loads that value into the textbox.

    if u click the button and the textbox is NOT empty it will set the "local key" called "my_games_highscore" to the value in the textbox.

    I hope that helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Naxos84 THANK YOU!! Not only did you help me out with my current problem, you gave me some awesome tips for other things I want to impliment later down the road! Thanks again!

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