Different animations for player in GDevelop 5

I’m going to show you how to add different animations for the same player.

The first thing you should do is configure the player animations, I prefer to start with 0 and undescore to separate, so it will be idle_0, run_0, jump_0 …

We are going to end with something like this. for animation 0 and 1

Next step, I alway use Storage to save the game data but this can be done as you want, the important thing is to check which animation the player is going to play depending which armor_equipped he has. So

Create a Scene Variable named gs_armor_equipped assign 0 this is a reference for you to know that idle_0, run_0, jump_0… is going to be plajyed.

Once this setep is done we need to do the logic of the animations in Events, depending on how you move the player for instance

Check if player is on Floor and is not attacking.

if the player is not moving which is perfectly logic at start of the Scene, we play the idle_0 animation, and if the player moves, left or right play run_0 animation

This way for you to change the player armor, sword, helmet or anything you want to attach is so simple as change the value of gs_armor_equipped value.

Build your GDevelop 5 game with yarn electron-builder

First we need to prepare the enviroment:
1 -Download and install yarn: https://yarnpkg.com/en/
2 -Open cmd prompt with administrator rights, change to the directory of your exported game.

Go to your folder game

c:/mygame/> yarn add electron-builder --dev

After the builder finish
Rename the buildResources folder to build go back to command line and write

yarn electron-builder build

After the builder finish, you can now access to the new created folder dist, inside is you game as an installer and another folder named win-unpacked, you can create your own installer using this folder with another software like InnoSetup or InstallForge

You can find detailed information here , the builder is electronjs and you can see the documentation here