feat: added some outward velocity to sliding

This commit is contained in:
Sara 2024-01-19 15:28:31 +01:00
parent 92bf07d050
commit 25badcb847

View file

@ -190,7 +190,7 @@ const State* PlayerSlide_Update(Player* self, float deltaTime) {
.knockback = 0.3f, .knockback = 0.3f,
}; };
const float time = animation_sprite_get_time(self->currentAnimation); 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) if(time > 0.34f)
return PlayerIdle(); return PlayerIdle();
if(time > 0.1f) if(time > 0.1f)
@ -200,6 +200,7 @@ const State* PlayerSlide_Update(Player* self, float deltaTime) {
void PlayerJump_Enter(Player* self) { void PlayerJump_Enter(Player* self) {
if(self->jumpInput) { if(self->jumpInput) {
self->jumpInput = 0;
self->currentAnimation = self->jump; self->currentAnimation = self->jump;
self->verticalVelocity = 3.f; self->verticalVelocity = 3.f;
} }