hey there, i have create a matching games for android phone, it has done but the problem is i did not know how to store the high score when player done playing my games.
There is anyone can help me. i need it to finish my study project.Help!
Search function in the tutorials as well as in the how do I forum will find you a great deal of information.
First hint, it has to do with the webstorage plugin and arrays.
A score system in a tutorial. You can find even more tutorials and score system spread over the website.
Develop games in your browser. Powerful, performant & highly capable.
The links posted by Kyatric will definitely be useful. You could also do some searches around the forum. You may just come across some useful information.
I'll try explaining it to you in basic logic.
If you plan to do just one "Best Score" for the user then you probably don't need arrays. Unless you want a leaderboard? Which I'm assuming you don't.
You should use webstorage to store the value. Webstorage will remove the stored value if you clear you cache (I believe this is how it works). So its good for storing or saving values.
webstoreage>setlocalvalue will let you store the required value into a "key".
you can then load value from the key to a global variable.
global variable num = 5;
webstoreage set localkey "getval" to num;
->You now have the localkey "getval" which has stored in the value 5 from num.
You can then load the key, and set num to this key by using a command like this:
Set num towebstorage.localvalue("getval");
num is now equal to the stored value in the key.
thank you Kyatric and retrodude it really useful. the tutorial really helping