I created a state machine with theses states: idle, run, jump, fall and attack.
When I press the attack button, that's what happens:
When the platform goes up, the player falls. When goes down, the player flies.
Here's the code of state_attack:
$anims.play(anim + str(dir_sprite))
if abs(vel.x) > 0:
I tried to insert the gravity and moveandslide in this state, but my charactes falls really fast after que animation of the attack.