Android save score

Get help using Construct 2

Post » Mon Feb 24, 2014 2:28 pm

Hi, I am really lost, the last thing I need for my game before I am done is how to save. I am making an android game that is like flappy bird. So can anyone please tell me how to save the highscore on the phone? I have many topics but I can't find anyone with step by step on how to do this. Please can anyone explain me the steps.

Thanks :)
B
2
Posts: 6
Reputation: 160

Post » Mon Feb 24, 2014 3:09 pm

Read the manual ! :)
https://www.scirra.com/manual/120/webstorage

The steps :

1) Save the data (Set local/session value
Store a value (string or number) for a key in local or session storage. If the key does not exist it is created, otherwise its value is simply updated.)

2) Read the data (LocalValue
SessionValue
Retrieve the value stored for a key in storage. If the key does not exist this returns 0.)
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Mon Feb 24, 2014 4:11 pm

For an example of how I did mine (not sure its the best or most effecient, but it does work for me), I have the settings that are shown at this image
My main issue going over it was getting it to display the highscore at the end, but was able to find the correct option after reading some of the posts on this forum.

Hope the screens help

http://game.reconone.info/files/config.png
B
6
Posts: 17
Reputation: 332

Post » Mon Feb 24, 2014 5:53 pm

sotak wrote:For an example of how I did mine (not sure its the best or most effecient, but it does work for me), I have the settings that are shown at this image
My main issue going over it was getting it to display the highscore at the end, but was able to find the correct option after reading some of the posts on this forum.

Hope the screens help

http://game.reconone.info/files/config.png


Hi when I play the game in preview from construct 2 and make for example 1 point and close the preview and open it again it doesn't save, is it because it doesn't save in the preview mode? This is for android phone I want to make it :) and thanks for your responses!!!
B
2
Posts: 6
Reputation: 160

Post » Tue Mar 04, 2014 8:43 pm

Nothinghaha wrote:
sotak wrote:For an example of how I did mine (not sure its the best or most effecient, but it does work for me), I have the settings that are shown at this image
My main issue going over it was getting it to display the highscore at the end, but was able to find the correct option after reading some of the posts on this forum.

Hope the screens help

http://game.reconone.info/files/config.png


Hi when I play the game in preview from construct 2 and make for example 1 point and close the preview and open it again it doesn't save, is it because it doesn't save in the preview mode? This is for android phone I want to make it :) and thanks for your responses!!!




The way i understand how it works (and thats going off about 2 weeks of using it) yes.

I know my screenshot is kinda...crazy looking, i still need to get time to clean it up and maybe post a tutorial on what I did to make it work.

If you can post a screenshot of your config, some of the smarter guys can take a closer look at it.
B
6
Posts: 17
Reputation: 332


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 7 guests