From 9321eb411faf01f3c1b375919534e58bc079fef5 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 7 Aug 2021 18:48:01 +0200 Subject: [PATCH] fix : some jump fixes --- sonic-radiance.love/scenes/battlesystem/actors/movable.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/movable.lua b/sonic-radiance.love/scenes/battlesystem/actors/movable.lua index baf0bd6..d9593e0 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/movable.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/movable.lua @@ -79,6 +79,7 @@ end function Movable:resetMotion() self.speed, self.angle = 0, 0 + self.xspeed, self.yspeed = 0,0 self:updatePreviousPosition() self:resetMovementType() @@ -189,7 +190,7 @@ end function Movable:updateDirection() -- Handle direction if math.abs(self.xspeed) >= 0.01 then - if (self.directionLocked == false) then + if not (self.directionLocked or self.jump.lockDir) then self.direction = utils.math.sign(self.xspeed) end end @@ -203,6 +204,7 @@ function Movable:resetJump() self.jump.isJumping = false self.jump.bounceNumber = 0 self.jump.stopWhenLanding = false + self.jump.lockDir = false self.zspeed = 0 self.motion3D = false @@ -210,6 +212,7 @@ function Movable:resetJump() end function Movable:stopJumping() + self.z = 0 self.tweens:newTimer(0.01, "jump") if (self.jump.stopWhenLanding) then self:resetMotion() @@ -239,6 +242,7 @@ end function Movable:jumpBack(height, speed) self:jumpTo(self.start.x, self.start.y, height, speed, true) + self.jump.lockDir = true end function Movable:getJumpMotion()