It looks like you're new here. If you want to get involved, click one of these buttons!
sets = dataSaver.loadValue("sets") -- if sets not defined (first time) -- set defaults if(not sets) then sets = {} sets.sounds = true sets.music = true sets.curLevel = 1 sets.levelUnLocks = {} sets.levelUnLocks[1] = 1 sets.advertising = true dataSaver.saveValue("sets", sets) end |
Likes: johnyc100
Comments
So first you load the values, so both file and table have same values, then during the game you keep updating table, and you can from time to time sync it with file by calling save value, or even set it up to be saved on App life cycle events.
And thats basically all you have to do, there is no need to reload data from file in the same app session, because you will already have updated information in table, since that is what you are updating.
Thats going to make things a bit neater. B-)
http://artleeapps.com/
Bubble Adventure - Colors
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
So much better. Thanks all :-)
http://artleeapps.com/
Bubble Adventure - Colors
If somebody edits your settings file could they change the ad removal flag or number of stars bought and play for free?
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
- so for the one off purchase of ad free currently thats a managed purchase. i could check it when i load the game and use that as a global.
- but what about the "stars", as currently they are unmanaged, the user could by 10 as one product, but use them in the game, and buy more... how would i secure that from tampering, i currently just update the data on the phone, after a purchase.
Would you know the code for reading Google Play for purchases please, as per the managed once off record...
http://artleeapps.com/
Bubble Adventure - Colors