From 44cda944f5a90b61352e25305cb0b077b2ec4488 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 7 Aug 2021 11:39:34 +0200 Subject: [PATCH] fix: make landing work --- .../scenes/battlesystem/actors/battler.lua | 7 +++++++ .../scenes/battlesystem/actors/movable.lua | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua index 29218ac..5a7506b 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua @@ -80,6 +80,13 @@ function Battler:update(dt) end end +-- Movement +-- Some specific movement function + +function Battler:land() + self:changeAnimation("idle") +end + -- CHOREGRAPHY FUNCTIONS -- All functions related to the choregraphy system diff --git a/sonic-radiance.love/scenes/battlesystem/actors/movable.lua b/sonic-radiance.love/scenes/battlesystem/actors/movable.lua index 0b6671e..baf0bd6 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/movable.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/movable.lua @@ -210,12 +210,16 @@ function Movable:resetJump() end function Movable:stopJumping() - self:resetJump() - self:finishAction("jump") + self.tweens:newTimer(0.01, "jump") if (self.jump.stopWhenLanding) then self:resetMotion() end - self:changeAnimation("idle") + self:resetJump() + self:land() +end + +function Movable:land() + -- Empty function end function Movable:setJump(power, bounceNumber, useDefaultAnimation)