Saving multiple Values
-
In my game for the retro coding competition I am trying to create a high score as well as different vehicles that the player can unlock. I got the high score to save but when I tried changing the handle that opens/closes etc the file the high score was overwritten. I do not want to have to make the player unlock all of the cars in one sitting as this could be tedious. Assuming the high score value is just highscore and each vehicle has a unlocked = true/false variable, how can I save the high score and the state of say 10 vehicles?
Thanks in advance and sorry, I know this question has been asked a lot but I still don't totally understand it. -
someone else could probably give you a better answer but what i'v done in one of my programs which saves multiple values is just duplicate the code so for you it would be a case of copying the highscore save and have unlockcar1 = true so on.Here is an example
https://fuzearena.com/forum/topic/781/persistent-data?_=1617208707733i'v also just shared my example which saves multiple values which is a modded version of pianofires
(saving seeker) 1y553MND5U
also on mine i'v set it up to save when the player sprite is at the computer, you can move the sprite with the d-pad then b to save;)
-
I agree. Pianofireโs example, that Waldron linked to above, is great for this!
-
Thanks for your help ๐
-
Maybe you only need one value to save, the number of unlocked cars or you can do this