Tweak player falling, prevent sprite spazzing.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user