My objective would be to create a skin system, I’d obviously have to create a skin selection menu and that’s not a problem, what would be the best practice to make it code-wise though?
Do I just make a bunch of sprites and various booleans that make it so that a skin is instantiated in the level when selected? If so, how could I make it so that making a boolean true (I’d make it probably through the press of a button) sets all the other skin booleans false? Do I just program the similarly to each turn off every other skin’s boolean? It would work but at long time it would be hard to add a new line of code on each skin (more skins I add the more booleans I have to add and call on the other skin’s booleans)
Depends on how you want your skin selection menu to look like, because there are multiple ways of how you can achieve that.
Ideally, you’d want to store the “selected skin” value within just one variable, not multiple booleans.
E.g. You can have all the skins stored in the Array, where you can easily reference them by index. You can change the index by buttons “next” and “previous” and update the display to show the skin from that index. If you want to add another skin to the mix - just add it to the array and that’s it.
Here’s my quick and dirty demo, where I’m selecting colors, but in your case these could be sprites, textures, whatever.