Highscore displaying NaN using webstorage

0 favourites
  • 3 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • So my game is almost finished and I wanted to add highscores. I searched for some tutorials and I read most of 'em. But for some reason the highscore value keeps displaying "NaN". For ease of understanding I created a new construct 2 project where I have the same problem.

    What am I doing wrong?

    The included capx file is very basic. Its a text box, when the game starts: every second 1 is added to score. and then if score is higher than highscore it will be saved and displayed.

  • set highscore to int(webstorage.localvalue("highscore")) will work as explained in the manual..

    Webstorage is stored as a string and a string is NaN (Not a Number), to convert the string to an integer(number) you use int..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • LittleStain thanx its helped me too

    Hello Sir, i wanted to implement facebook score system same like subway surfer? could you please help me and let me know if this possible without publishing on facebook? as i am only wanted to publish on mobile platform.

    Please help me to achieve this,

    Thanks in advance

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