How do I save game before quitting

Get help using Construct 2

Post » Thu Dec 18, 2014 9:18 pm

I want to implement permadeath in my top-down shooter, so generally I don't want to allow players to save. I created event that does it before closing game, but strange problem occurs - when I load saved game, it just closes game. It appears, that whole event is saved and then executed after loading game. It occurs no matter what I do - I tried to set variables that controls quitting (like EXITGAME = 1) after saving game, or use onsavecompleted event for exiting game, or use separate function for it - nothing helps. Unfortunatelly, I can't provide source file, because I deleted whole block and decided to create safe spots where player can save, but after that I thought, that maybe I should ask here. Has anybody tried to do it?
B
3
Posts: 24
Reputation: 298

Post » Thu Dec 18, 2014 11:19 pm

Umm...if you don't want the game to be savable, why are you trying to save the game? :?

To save, the best way is usually webstorage:

https://www.scirra.com/manual/120/webstorage

I assume you just want to keep high scores and what-not? Then put it in webstorage.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 22, 2014 8:54 pm

Maybe I was not clear. I want players to be able to continue game, after they exit. Then, if player decides to play again, he/she shoud start from the point where they ended last time. Although, I don't want to create possibility to save game manually - if player dies, it's over, you've got one life. If you die, you will have to start from beginning.
I want to make it on as many platforms as possible, for Android and iOS for sure. I tested exporting through Intel XDK and it works quite well, but I read somewhere on scirra website, that webstorage is not working in Android Apps in Google store. I'm not sure if built-in "save" and "load" actions work, because I haven't tested it opn Android yet - I hope they do.
B
3
Posts: 24
Reputation: 298

Post » Mon Dec 22, 2014 9:02 pm

webstorage does not work ATM on the google chrome web store, which is a store for desktop-chrome web apps and chrome OS.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Dec 22, 2014 9:54 pm

Right, so google play apps are still fine.

Just save the games progress into webstorage, clear it if the player dies, resume if the player quits and comes back. Which part of this is giving you trouble?
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202


Return to How do I....?

Who is online

Users browsing this forum: Resslx and 29 guests