NaN for High Score

0 favourites
  • 10 posts
From the Asset Store
High Low is a casino game using luck and points accumulation.
  • What is the problem with the highScore variable? Everytime I tested the game on Chrome, the High Score will be NaN. Any solution? Below are the screenshots

  • Possibly on the last event make sure the value is an integer with int(LocalStorage.ItemValue)? Not quite sure... I imagine it IS getting something, otherwise the high score would remain at 0.

    Or does it have the same problem with all the localstorage events disabled as well?

    Edit: I don't see where you set the HighScoreText to HighScore anywhere... Maybe you're just not displaying the number? When you check in debug mode, does the highScore variable show the correct number? Reference capx: https://www.dropbox.com/s/m5u06uuk9fh78 ... .capx?dl=0

  • I set the HighScoreText to highScore in Event sheet2 of Gameover layout. lh3.googleusercontent.com/-9duW ... 2event.jpg

    Will it be affected?

    What do you mean by the localstorage events disabled? Could you explain more about it? Thx

  • Look in the debugger at LocalStorage. You should see its contents.

    Is it full of jibber from previous projects or from versions of this project ?

    Then add keyboard. Assign a key > action > LocalStorage > Clear Storage.

    Run the project. (project, not layout) Press the key. Quit browser. Try again.

  • 99Instances2Go Yeay. It works. Thanks

    Oh.. What is the difference between Run Layout and Run Project?

  • 99Instances2Go Yeay. It works. Thanks

    Oh.. What is the difference between Run Layout and Run Project?

    If you had multiple Layouts in your project, then selecting 'Run Layout' would run the currently selected Layout, such as Level 5 of your game.

    'Run project' would run your project from the Layout stated in the Project Settings option of the Project Properties, usually set to 'Default', i.e. the first Layout of your project.

  • If you had multiple Layouts in your project, then selecting 'Run Layout' would run the currently selected Layout, such as Level 5 of your game.

    'Run project' would run your project from the Layout stated in the Project Settings option of the Project Properties, usually set to 'Default', i.e. the first Layout of your project.

    Ok. Thank you for the information

  • Well i dont see your capx, have no idea how many layouts & associated event sheets you have, no idea if you store and retreive in differend sheets ...... so i 'played' on save.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well i dont see your capx, have no idea how many layouts & associated event sheets you have, no idea if you store and retreive in differend sheets ...... so i 'played' on save.

    Beginner's Question

    Thanks much for your help by the way

  • I made this tutorial its easier to follow

    https://www.scirra.com/tutorials/5343/h ... -game-capx

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