I want my players to select various player character/skins, like to play as a human, frog, chicken, fox, etc. I have about a dozen of them. what is the best way to go about this?
One player sprite with a animation for each skin? Multiple player sprites all with just one set of skins? Some other awesome ideas I haven’t even thought of?
My biggest, but not only, concern is how I would play the correct animation skin when the player jumps, walks, etc. I would really like to avoid building a ton of “if globalvariable set to playerskin1 then use playerskin1jump”, etc. because there are various ways the player could do these actions (click on a object, press a button, etc) and those events are tied to a dozen different actions that I assume I would have to copy paste over and make just the one skin change on…a dozen times.
First one is to use one sprite with all the animations for all the skins and an instance variable to hold the name of the skin.
Each animation name will have to be in the format < skin_name >_< action >. For example Frog_idle, Frog_jump, Human_idle, Human_jump etc.
Store the skin selected in an instance variable on the sprite (in the screenshot below I’ve named it “Skin_Name”. Make sure the case matches that of the animation name.
The second way is to have a sprite for each skin and name the sprite in the format Player_< skin_name >. For example, Player_Frog, or Player_Human etc.
Ensure each sprite has the same behaviours, and all the animation names are the same (including case) for each action. Then add each of the sprites to an Object Group, say called Player.
When the skin is selected, create the player character and change animations with:
For managing multiple skins and animations, a good approach might be to use a single player sprite with a dynamic animation system. This way, you can have different animations for actions like jumping or walking, and just swap out the sprites or frames based on the selected character skin.
Instead of having a ton of separate “if” statements, you could use a more streamlined method. For example, set up a central system where you define actions and link them to specific skins. When an action occurs (like jumping or walking), the system checks the selected skin and plays the corresponding animation. This way, you avoid duplicating code and make it easier to manage.
I’ve had a similar experience with organizing assets for a project, and using a central management system really helped streamline the process. For instance, exploring the https://skin.land/market/ taught me a lot about efficiently handling and organizing various assets, which could be helpful for your setup.