diff --git a/src/player.c b/src/player.c index 678e306..380bdc7 100644 --- a/src/player.c +++ b/src/player.c @@ -10,8 +10,6 @@ static Vector _directional = ZeroVector; static Spritesheet* spr_player_standing = NULL; -static const int _ground_face = 7; - static void player_input_h(int val) { _directional.x = val * 10.f; @@ -58,7 +56,7 @@ void player_start(Player* self) { void player_update(Player* self, float dt) { Vector velocity = rigidbody_get_velocity(self->rigidbody); - Vector velocity_target = {_directional.x, velocity.y}; + Vector velocity_target = {self->is_grounded ? _directional.x : velocity.x, velocity.y}; if(_directional.y < 0 && self->is_grounded) { _directional.y = 0; velocity.y = -20.f;