How should I go about unlocking characters? #2504
-
So I want to make a thing where you can unlock characters and then choose them, but I'm not sure what method I should use to actually track what skins are unlocked. Should I have an array or something for each skin or something or use variables for each skin |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a good question but I guess more of a general game dev question than a HF specific one. Does your game support saving or not? If it supports saving then you can just use FlxSave to store an object of data:
I would not suggest having using nested objects in FlxSave as I've had bad results with this, instead, I would say you should use a string of 1s and 0s
and then turn that into an array. If your game doesn't support saves then you could store everything in a singleton that all the states in your game would have access to. I have a tutorial on how to do that here, although it's not flixel specific: |
Beta Was this translation helpful? Give feedback.
This is a good question but I guess more of a general game dev question than a HF specific one. Does your game support saving or not?
If it supports saving then you can just use FlxSave to store an object of data:
I would not suggest having using nested objects in FlxSave as I've had bad results with this, instead, I would say you should use a string of 1s and 0s
and then turn that into an array.
If your game doesn't support saves then you could store everything in a singleton that all the states in your game would have access to. I have a tutorial on how to do that here, although it'…