Save a Highscore Locally-Mobile

Get help using Construct 2

Post » Sun Nov 06, 2011 11:36 pm

Is there a way to save a highscore locally on an android phone so when you reopen the application your highscore for a level is still there? 100 different levels so 100 different highscores, can i save to some external document or something? or is there something built in to construct that i have not seen yet. Thank you in advance.
B
15
S
1
G
2
Posts: 62
Reputation: 1,696

Post » Sun Nov 06, 2011 11:46 pm

The webstorage object should handle all this for you.
Search the forum, you should find informations on how to use it.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sun Nov 06, 2011 11:49 pm

Thank you i will look more into websorage, just was not sure how it would work with android. Thanks again for your help!
B
15
S
1
G
2
Posts: 62
Reputation: 1,696

Post » Sun Nov 06, 2011 11:57 pm

I did read if they clear the Cache it will delete the saved scores via webstorage? is this true, if so would there be a better and safer way to save the highscores?
B
15
S
1
G
2
Posts: 62
Reputation: 1,696

Post » Mon Nov 07, 2011 12:03 am

Save it through AJAX on a server.

A topic
A tutorial
The answer to many questions
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Nov 07, 2011 12:24 am

I've been over the whole FAQ forum a few times and it is well done and very very helpful, it has answered alot of my questions but with ajax the mobile device would have to have a connection to the internet at all times for that high score system to work unless im mistaken which i could be, and some devices that might run this game could be wifi only, i was just wondering if there was a simple way to save locally that was somewhat secure, i dont really want someone to clear cache and lose all their high scores and i really did not want to host them on a server. but if i have no choice i will go with the webstorage option, thanks for your help :)
B
15
S
1
G
2
Posts: 62
Reputation: 1,696

Post » Mon Nov 07, 2011 12:35 am

So far, for strictly local save it is just the webstorage object.
I'm not sure if a cache clear affects the webstorage saved values. They are supposed to be in a specific spot of the browser. I don't really know much about it.

Anyway, JS is limited in such a way it is not supposed to give you access to the hard drive, so it is unlikely to have another way of storing local datas then the webstorage.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Nov 07, 2011 12:46 am

Thank you Kyatric, from everything ive read you really know your stuff and i appreciate you taking hte time to explain this ") ill use the web storage option, should work fine if the cache clear does effect it then oh well people need to be careful.
B
15
S
1
G
2
Posts: 62
Reputation: 1,696

Post » Mon Nov 07, 2011 6:35 am

What about native apps through phonegap? Are you saying that saving any data while offline will never be a possibility?sqiddster2011-11-07 06:35:47
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Tombas and 18 guests