fix : some jump fixes

This commit is contained in:
Kazhnuz 2021-08-07 18:48:01 +02:00
parent daae72dd8a
commit 9321eb411f

View file

@ -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()