diff options
author | kdx <kikoodx@paranoici.org> | 2023-03-20 18:41:00 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-03-20 18:41:00 +0100 |
commit | aeeddc8a005fc25c50594c7eb522042a10d67ebd (patch) | |
tree | e3c7162d744f8fc7aa5578364958b88ee43ac304 | |
parent | 2ae473a021a7b7603101fbb19e4a09eb7e497164 (diff) | |
download | hyperultra-aeeddc8a005fc25c50594c7eb522042a10d67ebd.tar.gz |
player angle only resets on floor
-rw-r--r-- | src/player.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c index 3298b52..dba2b44 100644 --- a/src/player.c +++ b/src/player.c @@ -17,10 +17,11 @@ IMPL_UPDATE() { if (fabs(this->player.scale_x - 1.0) < 0.05) this->player.scale_x = 1.01; if (fabs(this->player.scale_y - 1.0) < 0.05) this->player.scale_y = 1.01; - if (on_ground) { + if (this->vel[1] == 0.0 && on_ground) this->player.rot_speed = 0.0; + if (on_ground) this->player.angle = 0.0; - } else { + else { this->player.angle += this->player.rot_speed; this->player.rot_speed *= 0.95; } |