Compare commits
No commits in common. "a9bb7df18849da52d0261afa259c11ee8f354259" and "cd8d2768e0c848be5ab19dc8e2f5b75889eb40bb" have entirely different histories.
a9bb7df188
...
cd8d2768e0
@ -24,17 +24,6 @@ function mapBehavior.new(position, size)
|
||||
}, mapBehavior)
|
||||
end
|
||||
|
||||
--- @param position Vec3
|
||||
function mapBehavior:lookAt(position)
|
||||
self.owner:try(Tree.behaviors.sprite,
|
||||
function(sprite)
|
||||
if position.x > self.displayedPosition.x then sprite.side = sprite.RIGHT end
|
||||
-- (sic!)
|
||||
if position.x < self.displayedPosition.x then sprite.side = sprite.LEFT end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- @param path Deque
|
||||
--- @param animationNode AnimationNode
|
||||
function mapBehavior:followPath(path, animationNode)
|
||||
|
||||
@ -124,7 +124,9 @@ function attack:cast(caster, target)
|
||||
local targetSprite = targetCharacter:has(Tree.behaviors.sprite)
|
||||
if not sprite or not targetSprite then return true end
|
||||
|
||||
caster:try(Tree.behaviors.map, function(map) map:lookAt(target) end)
|
||||
if sprite.side == targetSprite.side then
|
||||
sprite.side = -sprite.side
|
||||
end
|
||||
|
||||
AnimationNode {
|
||||
onEnd = function() caster:has(Tree.behaviors.spellcaster):endCast() end,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user