How do I save entire game on iOS and Android

0 favourites
  • 5 posts
From the Asset Store
Shark.io
$9.99 USD
Shark.io in the sea full of killer sharks, Sunday of life is the game. Who knows what is happening under the sea?
  • Hey helpful readers,

    I am currently working on exporting my game to mobile devices (iOS and Android) and I would like to know how to create a save game feature which simply saves the users High Score, Gold, and In-App purchases when the app closes.

    I've noticed that the popular Save game action doesn't save In-App purchases (as written here: https://www.scirra.com/tutorials/526/ho ... -savegames). What does this mean exactly - are In-App purchases saved automatically? Surely there is a way to save the users purchases, could someone explain how?

    I am also looking at integrating Game Center for iOS score keeping and Google Play Leaderboards as well. I guess my main question is, why does this all seem like such a huge task, is there anyway to simplify all of this or am I over complicating it?

    Thanks guys.

  • In App purchases are their own beasts and are handled by the platform you are aiming for.

    In other words, you create them in a web interface (either an Apple website for iOS or a Google website for Android) and the platform handles them.

    You don't "save them", you only check in your code if your user has purchased the iAP items you created or not.

    Pretty much the same for Game Center and LeaderBoards, what seems complicated is that you have to go through external services that are originally designed for coders and programmers.

    Those interfaces weren't designed with the idea that non-tech savy people were going to use it, as C2 is.

    But in the end, it is not that complicated takes a bit of determination to go through though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Kyatric Thanks.

    I've got a question,

    Would LocalStorage be my best bet for saving things like the users High Score? I've followed the basic tutorial but it seems that there is a slight millisecond delay when the game starts during the time between fetching the LocalStorage key and displaying the amount on screen (as a Sprite Font Text object).

    On Start > LocalStorage: Check item "highscore_key" exists
    LocalStorage: On item "highscore_key" exists > System: Set HighScore to LocalStorage.ItemValue
    On game end.. > LocalStorage: Set item "highscore_key" to HighScore[/code:9ija0ov7]
    
    Is there anyway to make it instant?
    
    Thanks.
  • Kyatric Thanks.

    I've got a question,

    Would LocalStorage be my best bet for saving things like the users High Score? I've followed the basic tutorial but it seems that there is a slight millisecond delay when the game starts during the time between fetching the LocalStorage key and displaying the amount on screen (as a Sprite Font Text object).

    > On Start > LocalStorage: Check item "highscore_key" exists
    LocalStorage: On item "highscore_key" exists > System: Set HighScore to LocalStorage.ItemValue
    On game end.. > LocalStorage: Set item "highscore_key" to HighScore[/code:1raprmu1]
    
    Is there anyway to make it instant?
    
    Thanks.
    

    Like Ajax, localstorage loads asynchronously..

  • What LittleStain said.

    The LocalStorage is done in such a way that your game keep on executing while fetching the infos.

    It is actually up to you to "delay" the moment you display the scores to the moment they actually were loaded up. ("On item get" condition triggers)

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