Hi,
I looked through the manual on the local storage plugin and reviewed the previous high score tutorial on high score.
It goes something like this
global variable - Score and HighScore
Start of layout -Local storage - Check item "score" exist
-Local storage - Check item "highscore" exist
Touch- On touched sprite->Add 1 to Score
Local storage-on item "score "exist - set item "score"to Score
Local storage-on item "score " set - set item "score"to Score
Local storage-on item "score " missing - set item "score"to Score
Local storage-on item "score " get -get item "score"
Button - on Clicked - Set "highscore"to HighScore
->System - Score>HighScore - Local Storage - set "highscore"to Score
- set HighscoreText to ""&Score
->Else -System - set HighScore to 0
- set HighscoreText to ""&Score
I seemed to be unable to set the local storage for highscore to my global variable - HighScore. The global variable - HighScore remains 0 while I see the value in the Local storage key - highscore.
It also dont seem to be updating e.g if score is lower than Highscore, as it will override new value.
Can someone advise if I am setting one of the steps above incorrectly?
My 2nd question is, if I were to restart the layout, how do I retrieve the HighScore stored in the LocalStorage?