Hi, I’m in a need of help. After a year long break I’ve continued my project’s development. The progress has been good, until I tried to save some instance variables for the state of collectables.
I first tried it the same way as I previously had done with global variables (successfully), as shown in the pic below. The instance variable I’m trying to save is BmaskCollectedNum, the variable for the collectable mask’s state, which turns from zero to one when it’s collected. This solution did not work, the masks changed state would not remain when closing and reopening the game.
Next I tried using dictionary, because it seemed a common variable saving method, based on what I read from other threads about variable saving. I’m completely new to dictionaries, so I tried to understand them by studying the code of a metroidvania game template I bought from the Scirra asset store years ago, which heavily relies on dictionaries. The result is shown below and it still didn’t work. I guess I don’t understand dictionaries enough to know how to properly use them with instance variables.
Any help is appreciated.
And by the way, thank you very much for helping me know how to save global variables to local storage years ago. Sorry I forgot to reply to the last post. Saving global variables is no longer a problem, now I’d like to know how to do the same with instance variables. I actually tried to start this as a reply to my previous thread from two years ago, but the site didn't let me, so I made a new thread instead.