Saving high score locally.

Get help using Construct 2

Post » Wed Apr 13, 2016 2:23 am

So, in my game, after you lose, it takes you to a layout that shows you your score and the high score. I wanted to have the high score persist when you close and open the game again, so I decided to use the save game action to do that.

Turns out, it doesn't exactly work as intended. I thought a save file only kept the values of variables. It does save the variables, and the high score variable is kept as it was before, but when I have the game load a save, it jumps to the game over layout, the one where the game is saved. It was supposed to only load the variables and stay in the same layout.

I'm clearly doing something wrong here.

How would I do something like this, the right way?
B
15
S
2
G
3
Posts: 45
Reputation: 2,638

Post » Wed Apr 13, 2016 2:55 am

You are going to need to use the localstorage plugin for that. LocalStorage is a storage of keys with values and persist even when you load your game data, close or re-open your game.

Try this tutorial:
https://www.scirra.com/tutorials/1461/h ... age-plugin
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,857


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel and 24 guests