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
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

View file

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

View file

@ -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},
}
}

View file

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