How do I save scores?

Get help using Construct 2

Post » Sat Apr 18, 2015 5:20 pm

Also tell me how to replace the existing score value with higher score value.
B
24
S
7
Posts: 337
Reputation: 2,224

Post » Sat Apr 18, 2015 9:02 pm

I'm not sure what you mean..
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 » Sun Apr 19, 2015 10:07 am

Ok. The localstorage codes which u have provided are working, thanks for that.

Now, whenever i'm playing a level its score is getting updated with the fresh score in the Menu i.e., for example, I played level one and my score is 4000 points and again I played the same level (Level one) for second time, my score is 3500. Now, the score 4000 is being replaced by 3500 which I made while playing second time. This shouldn't happen. The score should be replaced when the score is higher than the previous score (4000).

I hope u understood what i'm trying to say.
B
24
S
7
Posts: 337
Reputation: 2,224

Post » Sun Apr 19, 2015 11:08 am

Easiest way would be adding a global variable level1score

on level1 completed (this is not an official event, but I'm sure you have an event taking place at this time)
system compare variable score > level1score
> localstorage - set item "level1Score" to Score
> system set level1score = score
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 » Sun Apr 19, 2015 11:12 am

There's more than one tutorial about highscores in the tutorial section.

I assumed you new how to do this and had a specific reason for having to use the localstorage instead of a combination of global variables and local storage.
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 » Sun Apr 19, 2015 1:25 pm

Ok tnx...i'll try that :)
B
24
S
7
Posts: 337
Reputation: 2,224

Post » Sun Apr 19, 2015 6:32 pm

Dude, Thnx alot. Ur really great help to me. Now, i got what i wanted.
B
24
S
7
Posts: 337
Reputation: 2,224

Post » Thu Aug 20, 2015 9:42 pm

Thanks @LittleStain ;)
Positive, inspiring and jazzy games!

www.crystalgames.space

Enjoy!
B
17
S
8
G
3
Posts: 174
Reputation: 3,455

Post » Sun Oct 16, 2016 9:18 pm

I got this working too.
--But I want to--
(1)1+2=display in result and in valuebox1.
on second result
(2)2+3=display in result and in valuebox1, the first result has moved to valuebox2.
on third result
(2)9+8=display result and in valuebox1, the second result moves to valuebox2, the first result moves to valuebox3.
B
31
S
13
G
1
Posts: 41
Reputation: 2,958

Previous

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 7 guests