How do I save game before quitting

0 favourites
  • 5 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • 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?

  • Umm...if you don't want the game to be savable, why are you trying to save the game? <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused">

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • webstorage does not work ATM on the google chrome web store, which is a store for desktop-chrome web apps and chrome OS.

  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)