HighScore

Get help using Construct 2

Post » Thu May 28, 2015 10:22 am

Hello,

I downloaded v.206 of Construct, and WebStorage is replaced with LocalStorage. So, now I can't find a solution with tutorials on the Internet for High Score.
I make a Score, but I need help for HighScore. Does anyone have an example?

Thanks
B
5
S
1
Posts: 31
Reputation: 437

Post » Thu May 28, 2015 10:38 am

So glad this forum has a search function I am able to use, when people ask questions..

how-do-i-make-higscore-with-local-storage_t129603
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 28, 2015 12:03 pm

I need something easier. With WebStorage it was easier. I'm sure there's another way.

Thanks anyway.
B
5
S
1
Posts: 31
Reputation: 437

Post » Thu May 28, 2015 12:21 pm

In what way would you like it to be easier?

Image

what part of this is too difficult?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 28, 2015 7:19 pm

Unfortunately when starting, a pageful of code like the above can be daunting. However it is a very good example of how to use local storage.

Lines 1-4 - Retrieve High score from local storage
Lines 5-6 - Simulate game increasing your score
Lines 7-9 - Save High score to local storage
Lines 10-12 - Not applicaple to the query

Local storage is very useful and imo even more so when combined with a dictionary object to avoid racing issues for multiple variables.
B
13
S
2
G
1
Posts: 22
Reputation: 760

Post » Sun May 31, 2015 8:55 am

I tried. But I missed something. Score is ok, but for High Score i have " High Score: " without numbers. I attached code.
Maybe some skillful see a mistake. Thanks

Image
B
5
S
1
Posts: 31
Reputation: 437

Post » Sun May 31, 2015 9:26 am

you have two events "on highscore get", one setting it to 0 and one setting it to localstorage.Itemvalue..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jun 02, 2015 10:13 am

Thank you.
B
5
S
1
Posts: 31
Reputation: 437


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests