Save and load level stars in array!

0 favourites
  • 6 posts
From the Asset Store
Is a circular loading screen with code ready to use. No Animation.
  • I wanted to store star counts for each level in array and save it and load from where it left. The problem..everything is stored before loading...but after loading, only 1 value is shown and even stars are not blinking. i have done the same method for highScore , it's working.

    The above is : at end of each level, based on time,mission and health...the value gets added..and stored in array "starLevels". eg : lev1: 3, lev2: 2 etc....

    The above is :loading the saving array on start of the layout.

    The above is : at the time of load

    The above is : at the time of save

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do you know for certain that you are setting the local storage item after you have updated the array and not before? The order of events in the event sheet also matters as they run top to bottom.

  • what should i do now..please help me...

  • It's difficult to tell if this is multiple event sheets and where they are linked, but I would focus on the setting of the array value on completion of the level. You could move this to the same end of layout event as when you save the array in local storage. The first screenshot is problematic, too difficult to tell what's going on.

  • yes, this is multiple event sheet...but save and load are in the same event sheet...the first screen is just adding the stars , what player earned.The last image is the completion of the level...above the last one is the loaded array(after game restart).What should i do now..want everything related to store and load array at the end?

  • The first screen is also updating the array. You want to make sure the save happens after this. You should move the updates of the array to the end of the level. If you finish the level then I guess you know how many stars to add so it should be easy to add to the end of layout event but before the save to local storage action.

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