Save Progress

Get help using Construct 2

Post » Thu Jul 04, 2013 9:54 pm

Hi everybody! So I am making a game, it has array-based level select. How do I create a save system, that saves level progress, lives and other variables automatically after completing a level? I need something like "Sonic the Hedgehog 4" or "Angry Birds" save systems.

Thanks for attention
B
11
S
4
G
2
Posts: 11
Reputation: 1,869

Post » Fri Jul 05, 2013 11:22 am

Scirra Founder
B
387
S
229
G
87
Posts: 24,245
Reputation: 192,160

Post » Fri Jul 05, 2013 12:37 pm

Thanks for reply, but I don't need to save EXACTLY where I left off. I just need to save which levels are open, complete or closed, and global variables. And when player starts the game, it automatically loads it, like in Angry Birds/Where's My Water and etc.
B
11
S
4
G
2
Posts: 11
Reputation: 1,869

Post » Fri Jul 05, 2013 1:39 pm

[QUOTE=nurzhanCAKE] Thanks for reply, but I don't need to save EXACTLY where I left off. I just need to save which levels are open, complete or closed, and global variables. And when player starts the game, it automatically loads it, like in Angry Birds/Where's My Water and etc.[/QUOTE]

Take a look at webstorage object. You can save your variables between game restarts, and initialize your game based on those.
B
24
S
9
G
7
Posts: 756
Reputation: 7,292

Post » Fri Jul 05, 2013 2:46 pm

Thanks a LOT! It is exactly what I need!
B
11
S
4
G
2
Posts: 11
Reputation: 1,869

Post » Sat Jul 06, 2013 1:05 am

I am still having problems. I did the level select by using this tutorial https://www.scirra.com/tutorials/311/level-select. When I save "currentlevel" variable to WebStorage, then quit the game and load it, I get "currentlevel" opened, but all previous levels get locked again. What am I doing wrong? Please help me understand!

And when do I load all the variables? Do I have to create "loader" layout to do it?
B
11
S
4
G
2
Posts: 11
Reputation: 1,869

Post » Sat Jul 06, 2013 1:44 am

maybe for loop, if currentlevel is a number

"unlocklevels" 0 to var currentlevel
> unlock function (actions you use for unlocking)
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests