From 25badcb8479297a18ad56ef6ab594225857f3d8c Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 19 Jan 2024 15:28:31 +0100 Subject: [PATCH] feat: added some outward velocity to sliding --- game/src/PlayerStates.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game/src/PlayerStates.c b/game/src/PlayerStates.c index c0054e8..952457d 100644 --- a/game/src/PlayerStates.c +++ b/game/src/PlayerStates.c @@ -190,7 +190,7 @@ const State* PlayerSlide_Update(Player* self, float deltaTime) { .knockback = 0.3f, }; const float time = animation_sprite_get_time(self->currentAnimation); - rigidbody_set_velocity(self->rigidbody, MakeVector(self->facing * 3.f, 0.f)); + rigidbody_set_velocity(self->rigidbody, MakeVector(self->facing * 3.f, -0.05f)); if(time > 0.34f) return PlayerIdle(); if(time > 0.1f) @@ -200,6 +200,7 @@ const State* PlayerSlide_Update(Player* self, float deltaTime) { void PlayerJump_Enter(Player* self) { if(self->jumpInput) { + self->jumpInput = 0; self->currentAnimation = self->jump; self->verticalVelocity = 3.f; }