Tweak player falling, prevent sprite spazzing.

This commit is contained in:
2025-03-19 02:46:03 -04:00
parent 8a3ed23302
commit c604b69487
2 changed files with 3 additions and 2 deletions

View File

@@ -17,7 +17,8 @@ void CaveGame::Core::Player::Draw() {
AABB2D quad = Frame_Idle;
if (!on_ground && Math::Abs(velocity.y) > 5.f)
// TODO: Work on conditions to make the player sprite not rapidly change to 'falling' when dropping 1-tall steps.
if (!on_ground && ( airtime > 0.1f || Math::Abs(velocity.y) > 10.f ))
{
if (velocity.y < 0)
quad = Frame_Ascend;

View File

@@ -56,7 +56,7 @@ namespace CaveGame::Core {
walking = true;
}
protected:
// TODO: Duplicated in Explosion.hpp. Refactor into AnimatedSprite class?
// TODO: Duplicated in Explosion.hpp. Refactor into Sprite class?
float anim_timer = 0;
};