Refactor light animation in regenerateMana spell using easing
This commit is contained in:
parent
4431934e6b
commit
0d2ed101d6
@ -11,6 +11,7 @@ local task = require 'lib.utils.task'
|
||||
local spell = require 'lib.spell.spell'
|
||||
local targetTest = require 'lib.spell.target_test'
|
||||
local Query = require "lib.spell.target_query"
|
||||
local easing = require "lib.utils.easing"
|
||||
|
||||
local walk = setmetatable({
|
||||
--- @type Deque
|
||||
@ -89,17 +90,12 @@ local regenerateMana = spell.new {
|
||||
Tree.behaviors.positioned.new(caster:has(Tree.behaviors.positioned).position + Vec3 { 0.5, 0.5 }),
|
||||
}
|
||||
|
||||
local flash = function(callback)
|
||||
light:has(Tree.behaviors.light):animateColor(Vec3 {})(
|
||||
function()
|
||||
light:die()
|
||||
callback()
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
return task.wait {
|
||||
flash,
|
||||
task.chain(task.tween(light:has(Tree.behaviors.light) --[[@as LightBehavior]],
|
||||
{ intensity = 1, color = Vec3 {} }, 1000, easing.easeInCubic), function()
|
||||
light:die()
|
||||
return task.fromValue()
|
||||
end),
|
||||
sprite:animate("hurt")
|
||||
}
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user