How to store highscore for android smartphone

Just started using Construct 2? Post your questions here

Post » Fri Feb 28, 2014 3:57 am

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!
B
2
Posts: 2
Reputation: 154

Post » Fri Feb 28, 2014 8:10 am

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.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Sun Mar 02, 2014 4:01 pm

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.

@noless
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.

Event>Action
webstoreage>setlocalvalue will let you store the required value into a "key".
you can then load value from the key to a global variable.

For example:
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.
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Fri Mar 07, 2014 1:17 pm

thank you Kyatric and retrodude it really useful. the tutorial really helping :)
B
2
Posts: 2
Reputation: 154


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests