Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Saving multiple Values

    Coding
    3
    5
    303
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ben 2.0
      Ben 2.0 last edited by

      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.

      1 Reply Last reply Reply Quote 1
      • waldron
        waldron F last edited by waldron

        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?_=1617208707733

        i'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;)

        1 Reply Last reply Reply Quote 1
        • vinicity
          vinicity F last edited by

          I agree. Pianofire’s example, that Waldron linked to above, is great for this!

          1 Reply Last reply Reply Quote 1
          • Ben 2.0
            Ben 2.0 last edited by

            Thanks for your help 👍

            1 Reply Last reply Reply Quote 2
            • waldron
              waldron F last edited by

              Maybe you only need one value to save, the number of unlocked cars or you can do this

              https://fuzearena.com/help/view/struct

              1 Reply Last reply Reply Quote 0
              • First post
                Last post