How do I save entire game on iOS and Android

Get help using Construct 2

Post » Wed Oct 28, 2015 7:29 am

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.
B
86
S
29
G
10
Posts: 100
Reputation: 10,535

Post » Wed Oct 28, 2015 10:58 am

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.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Tue Nov 10, 2015 12:41 am

@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).

Code: Select all
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


Is there anyway to make it instant?

Thanks.
B
86
S
29
G
10
Posts: 100
Reputation: 10,535

Post » Tue Nov 10, 2015 9:48 am

Badmiracle wrote:@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).

Code: Select all
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


Is there anyway to make it instant?

Thanks.


Like Ajax, localstorage loads asynchronously..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 10, 2015 10:01 am

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)
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306


Return to How do I....?

Who is online

Users browsing this forum: ardhitosen, kurtbal and 9 guests