TheSeekerGame / TheSeeker

Metroidvania game in Bevy
73 stars 16 forks source link

Fix Fall Animation [ $15 ] #106

Closed c12hz closed 1 month ago

c12hz commented 1 month ago

Currently the fall animation gets triggered whenever the player enters fall state. But the fall state can sometimes actually have an upwards velocity. For example with our variable jump height mechanic when you jump and then release the jump button quickly you will stop jumping and go into fall state, but the velocity won't get cut to 0 immediately but have some deceleration, so for a few frames the player will be in a fall state while still moving up. This looks a bit unnatural when the fall animation is applied.

So I think the best solution would be add a condition to the fall animation play_key, to only trigger it when player is in fall state and player y velocity is negative. The play_key can be found in player_anim.rs