fix(cbs): fix an hiccup

This commit is contained in:
Kazhnuz 2019-08-25 16:01:09 +02:00
parent 737d0e5a69
commit da3ab42f32

View file

@ -126,7 +126,7 @@ function Hero:getMovementDuration(dx, dy, duration)
end
function Hero:goTo(dx, dy, timerName, duration)
local duration = math.min(self:getMovementDuration(dx, dy, duration), 0.30)
local duration = math.max(self:getMovementDuration(dx, dy, duration), 0.30)
if duration > 0 then
self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad')
end
@ -134,7 +134,7 @@ function Hero:goTo(dx, dy, timerName, duration)
end
function Hero:jumpTo(dx, dy, size, timerName, spinjump, duration)
local duration = math.min(self:getMovementDuration(dx, dy, duration), 0.30)
local duration = math.max(self:getMovementDuration(dx, dy, duration), 0.30)
self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad')
self.tweens:newTimer(duration + 0.02, timerName)
self:setJump(size, spinjump, duration)