feat: improve a bit the choregraphies

This commit is contained in:
Kazhnuz 2020-07-25 17:07:53 +02:00
parent f3d44e06d1
commit b247e9cc96
4 changed files with 23 additions and 6 deletions

View file

@ -12,6 +12,7 @@ return {
targetNumber = 1, -- 0 for targeting all ennemies targetNumber = 1, -- 0 for targeting all ennemies
choregraphy = { -- the main attack choregraphy choregraphy = { -- the main attack choregraphy
{"setAnimation", "none", "walk", false},
{'goTo', "none", "target", -1, 0, 0.3, true}, {'goTo', "none", "target", -1, 0, 0.3, true},
{'playSFX', "none", 'hit'}, {'playSFX', "none", 'hit'},
{'setAnimation', "none", 'hit1start', true}, {'setAnimation', "none", 'hit1start', true},
@ -35,7 +36,9 @@ return {
{'setAnimation', "none", 'hit3end', true}, {'setAnimation', "none", 'hit3end', true},
{'setAnimation', "none", 'idle', false}, {'setAnimation', "none", 'idle', false},
{'wait', "none", 0.2}, {'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 onContact = { -- if the attack move and touch multiple ennemies, you can add

View file

@ -11,14 +11,20 @@ return {
targetEnnemies = true, targetEnnemies = true,
choregraphy = { -- the main attack choregraphy 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}, {"setAnimation", "none", "spin", false},
{'playSFX', "none", 'spinrelease'}, {'playSFX', "none", 'spinrelease'},
{"goTo", "none", "target", 0, 0, 0.3, true}, {"waitActorFinished", "none", "goTo"},
{"sendDamage", "none", 120, 100, false, false}, {"sendDamage", "none", 120, 100, false, false},
{'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false},
{'playSFX', "sentDamage", 'hitconnect'}, {'playSFX', "sentDamage", 'hitconnect'},
{'jumpBack', "none", 0.3, true}, {'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 onContact = { -- if the attack move and touch multiple ennemies, you can add

View file

@ -14,6 +14,9 @@ return {
{'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false},
{'playSFX', "sentDamage", 'hitconnect'}, {'playSFX', "sentDamage", 'hitconnect'},
{'jumpBack', "none", 0.3, true}, {'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},
} }
} }

View file

@ -118,7 +118,7 @@ end
function Hero:updateDirection() function Hero:updateDirection()
-- Handle direction -- Handle direction
if math.abs(self.xspeed) > 0 then if math.abs(self.xspeed) >= 0.01 then
if (self.directionLocked == false) then if (self.directionLocked == false) then
self.direction = utils.math.sign(self.xspeed) self.direction = utils.math.sign(self.xspeed)
end end
@ -197,6 +197,11 @@ end
function Hero:choregraphyEnded() function Hero:choregraphyEnded()
self.direction = 1 self.direction = 1
self.x = self.start.x
self.y = self.start.y
self.xspeed = 0
self.yspeed = 0
self.movementType = MOVEMENT_NONE
end end
-- ASSETS FUNCTIONS -- ASSETS FUNCTIONS
@ -225,7 +230,7 @@ function Hero:updateAnimation(dt)
end end
end end
self:setCustomSpeed(self.gspeed * 320) self:setCustomSpeed(self.gspeed * 160 * dt)
end end
-- DRAW FUNCTIONS -- DRAW FUNCTIONS