About highscore ?

Get help using Construct 2

Post » Thu Feb 20, 2014 8:19 am

In my game, i want to creat local highscore using webstorage.

If my first time played the game, i'm only dead 5 times. The best score will be 5.
When i play the game again, i'm dead 3 times, the best score will be set to from 5 to 3, and play it again, if i dead 10 times, the score still be 3. How can i do that?? An example will be great. Thank you all!

The logic about increase the score is simple but decrease it make me sick :(
B
50
S
12
G
7
Posts: 259
Reputation: 10,381

Post » Thu Feb 20, 2014 8:39 am

There have been multiple threads about highscore recently (like this one).

Having a "low score" instead of an high score just change 1 thing : the comparison sign.
For a highscore, at the end of the game, you compare "newScore > highScore", and if it is true, you set a new highscore, display something on screen, ... Just change it to "newScore < highScore" and you will handle everything else exactly the same.
B
17
S
8
G
4
Posts: 473
Reputation: 6,191

Post » Thu Feb 20, 2014 1:25 pm

I did it this way for instance

Image
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Thu Feb 20, 2014 2:54 pm

@vagaev, @Guizmus , thank you guys ! It's work so well, thank for your time.
B
50
S
12
G
7
Posts: 259
Reputation: 10,381


Return to How do I....?

Who is online

Users browsing this forum: 25games and 26 guests