From b247e9cc96630dbce89332f57e6d30adb17dcece Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 17:07:53 +0200 Subject: [PATCH] feat: improve a bit the choregraphies --- sonic-radiance.love/datas/gamedata/skills/attack.lua | 5 ++++- .../datas/gamedata/skills/spinattack.lua | 10 ++++++++-- sonic-radiance.love/datas/gamedata/skills/spindash.lua | 5 ++++- .../scenes/battlesystem/actors/hero.lua | 9 +++++++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index 3b094d3..54c43e9 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -12,6 +12,7 @@ return { targetNumber = 1, -- 0 for targeting all ennemies choregraphy = { -- the main attack choregraphy + {"setAnimation", "none", "walk", false}, {'goTo', "none", "target", -1, 0, 0.3, true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit1start', true}, @@ -35,7 +36,9 @@ return { {'setAnimation', "none", 'hit3end', true}, {'setAnimation', "none", 'idle', false}, {'wait', "none", 0.2}, - {'goTo', "none", "start", 0, 0, 0.3, true} + {"setAnimation", "none", "walk", false}, + {'goTo', "none", "start", 0, 0, 0.3, true}, + {'setAnimation', "none", 'idle', false}, }, onContact = { -- if the attack move and touch multiple ennemies, you can add diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index d7c6daf..1616646 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -11,14 +11,20 @@ return { targetEnnemies = true, choregraphy = { -- the main attack choregraphy + {"setAnimation", "none", "walk", false}, + {"goTo", "none", "target", 0, 0, 0.6, false}, + {"wait", "none", 0.3}, {"setAnimation", "none", "spin", false}, {'playSFX', "none", 'spinrelease'}, - {"goTo", "none", "target", 0, 0, 0.3, true}, + {"waitActorFinished", "none", "goTo"}, {"sendDamage", "none", 120, 100, false, false}, {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", 0.3, true}, - {'goTo', "none", "start", 0, 0, 0.2, true} + {"wait", "none", 0.1}, + {"setAnimation", "none", "walk", false}, + {'goTo', "none", "start", 0, 0, 0.3, true}, + {'setAnimation', "none", 'idle', false}, }, onContact = { -- if the attack move and touch multiple ennemies, you can add diff --git a/sonic-radiance.love/datas/gamedata/skills/spindash.lua b/sonic-radiance.love/datas/gamedata/skills/spindash.lua index 7f67d37..02a2076 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spindash.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spindash.lua @@ -14,6 +14,9 @@ return { {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", 0.3, true}, - {'goTo', "none", "start", 0, 0, 0.2, true} + {"wait", "none", 0.1}, + {"setAnimation", "none", "walk", false}, + {'goTo', "none", "start", 0, 0, 0.3, true}, + {'setAnimation', "none", 'idle', false}, } } diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 944637f..00ecd7c 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -118,7 +118,7 @@ end function Hero:updateDirection() -- Handle direction - if math.abs(self.xspeed) > 0 then + if math.abs(self.xspeed) >= 0.01 then if (self.directionLocked == false) then self.direction = utils.math.sign(self.xspeed) end @@ -197,6 +197,11 @@ end function Hero:choregraphyEnded() self.direction = 1 + self.x = self.start.x + self.y = self.start.y + self.xspeed = 0 + self.yspeed = 0 + self.movementType = MOVEMENT_NONE end -- ASSETS FUNCTIONS @@ -225,7 +230,7 @@ function Hero:updateAnimation(dt) end end - self:setCustomSpeed(self.gspeed * 320) + self:setCustomSpeed(self.gspeed * 160 * dt) end -- DRAW FUNCTIONS