feature/shadows #25

Merged
PeaAshMeter merged 14 commits from feature/shadows into main 2026-01-18 01:11:05 +03:00
2 changed files with 18 additions and 3 deletions
Showing only changes of commit 26633db3c3 - Show all commits

View File

@ -2,6 +2,9 @@
--- @field intensity number
--- @field color Vec3
--- @field seed integer
--- @field colorAnimationNode? AnimationNode
--- @field targetColor? Vec3
--- @field sourceColor? Vec3
local behavior = {}
behavior.__index = behavior
behavior.id = "light"
@ -16,7 +19,18 @@ function behavior.new(values)
}, behavior)
end
function behavior:update()
function behavior:update(dt)
if not self.colorAnimationNode then return end
local delta = self.targetColor - self.sourceColor
self.color = self.sourceColor + delta * self.colorAnimationNode:getValue()
self.colorAnimationNode:update(dt)
end
function behavior:animateColor(targetColor, animationNode)
if self.colorAnimationNode then self.colorAnimationNode:finish() end
self.colorAnimationNode = animationNode
self.sourceColor = self.color
self.targetColor = targetColor
end
function behavior:draw()

View File

@ -107,9 +107,10 @@ function regenerateMana:cast(caster, target)
AnimationNode {
function(node)
light:has(Tree.behaviors.residentsleeper):sleep(node)
light:has(Tree.behaviors.light):animateColor(Vec3 {}, node)
end,
duration = 400,
easing = easing.easeInQuad,
duration = 800,
onEnd = function() light:die() end
}:run()