How do I save game progress

0 favourites
  • 11 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Pls tell me friends

    how to save game progress

  • What do you actually mean with game progress? Just a few variables or/and the current position?

    The easiest way would be the Save/Load SaveGame function. Otherwise use an array and save the array in the LocalStorage.

    Regards

  • I have variables

    .

    i have level selection

    .

    i have character selection

    .

    .

    pls tell me how could i save all these, for devices and desktops both

    ..

    .

    can you give me any example of doing this process

    What do you actually mean with game progress? Just a few variables or/and the current position?

    The easiest way would be the Save/Load SaveGame function. Otherwise use an array and save the array in the LocalStorage.

    Regards

  • All your mentioned points are coverd by my Modular Game Template

    https://www.scirra.com/store/royalty-fr ... plate-1287

    There you find a way how to save progress with Arrays and LocalStorage.

    I don't have a free example for that, sorry.

    If you want to try it on your own, this tutorial will help you:

    https://www.scirra.com/tutorials/1461/h ... age-plugin

    Regards

  • i have already read this post

    i have downloaded file too

    .

    your have use local storage for coins

    but when i create sprite in your file and adding coins to variable it never saving its process

    after reload

    game starting from 0

    may be m not getting proper

    here is screenshot

    dropbox.com/s/gkz6kdb06pfm7bn/sample%20copy.jpg?dl=0

  • i have already read this post

    i have downloaded file too

    .

    your have use local storage for coins

    but when i create sprite in your file and adding coins to variable it never saving its process

    after reload

    game starting from 0

    may be m not getting proper

    here is screenshot

    Because your saving function is wrong.

    You must use

    LocalStorage - Set key 'playercoins_key' to playercoins

    instead.

    Regards

  • but this is totally your file that i have download

    i have just added a bouncing ball and with every bouncing add 1 to player coin

    .

    i have done nothing with with this file

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, and the part you added is missing the fact of saving some informations.

    The default capx does check on start of execution of the game if a key exists.

    If it doesn't, it creates a default value and creates the key,

    Otherwise, it sets a global variable value to the value contained in the key.

    Then you added a modification of the global variable, but at no point did you save the value of this variable to the key.

    So the modification is lost each time you execute the game and only loads the "default value" which is contained in the key.

  • Kyatric

    can you explain it in simple way

    actually my English is not so gud

    .

    what does it mean

    ''but at no point did you save the value of this variable to the key.''

    .

    i have just add coins to check how its working

    so pls tell me how can i add coins to variable

    Yes, and the part you added is missing the fact of saving some informations.

    The default capx does check on start of execution of the game if a key exists.

    If it doesn't, it creates a default value and creates the key,

    Otherwise, it sets a global variable value to the value contained in the key.

    Then you added a modification of the global variable, but at no point did you save the value of this variable to the key.

    So the modification is lost each time you execute the game and only loads the "default value" which is contained in the key.

  • This means that you have to save the variable after each change of it.

    I already mentioned above how you can save it. Jusr add this after you had updated the coins.

    Regards

  • ohh yes yes yes yes yes

    .

    i got the point

    yes i got the point

    .

    .

    thank you friends

    .

    .

    actually when you say

    LocalStorage - Set key 'playercoins_key' to playercoins

    then i thought its already written

    then why you saying it again

    .

    i didn't get that point

    .

    .

    now when you say UPDATE

    i just copy above action

    and its working

    thankyou friend

    thanks again

    .

    its my first step to saving game

    further have many points to ask but not NOW but'll later

    thanksssssss

    This means that you have to save the variable after each change of it.

    I already mentioned above how you can save it. Jusr add this after you had updated the coins.

    Regards

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