How do I to save variable forever?

  • i have in-app purchase in game

    When a player buys weapons in the game, the global variable is changed, how do I properly maintain this variable to the next time the player entering the game, had open arms?

  • Webstorage

  • u have video tutorial?

  • Webstorage

    this is not true, webstorage is not a good way to save something "forever".... but it's a good solution just for the apps for android or iOS, and I'm not sure, but I think if you remove the game, you will lost everything...

    for the computer, webstorage is useless if you want store some important data..etc.... is good just if you want to remember something not important... (if you delete the cache...you can say bye bye to your savegame...)

    the best, it's to save data in your server with a personal access for that user...so, you have everything in your server, and If AJAX works in mobile (I never tested) this is the best way if you want to save something forever

  • Ribis Webstorage is not deleted when the cache is cleared afaik.

  • You could always make the game online and store stuff in mySQL which would be more better if you understand php as you can change someones item if they exploit it or refund someone.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ribis Webstorage is not deleted when the cache is cleared afaik.

    yes, in my computer if you save something in webstorage, and you clean everything cache...etc (from chrome), you will lose everything....

    another point, it's a piece of cake to hack it... if you store coins, levels...etc, you can hack everything in 5 click, you don't need any software to do it...just chrome works for you

    the best is to store everything in your server, but in other hand you must have a connection if you are making a game on internet, with nodewebkit you can save file in the computer, if I remember...

    You could always make the game online and store stuff in mySQL which would be more better if you understand php as you can change someones item if they exploit it or refund someone.

    this is the solution, you can also save JSON file for load some level (taken coin...etc)

  • As Defender225 want to save IAP data, it is not a problem to use WebStorage, because he always fetch items first then storage info in WS.

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