пупупу... ой, то есть pupupu...

try to fix side draw (after initial side draw)
This commit is contained in:
Neckrat 2025-08-15 19:34:56 +03:00
parent 541c692f82
commit 7753413385
2 changed files with 9 additions and 6 deletions

View File

@ -24,7 +24,15 @@ end
function logic:followPath(path)
if path:is_empty() then return end
self.mapLogic.path = path;
self:runTo(path:peek_front())
---@type Vec3
local nextCell = path:peek_front()
local charPos = self.mapLogic.position
if nextCell.x < charPos.x then
Tree.level.characters[self.id].graphics.animation.side = LEFT
elseif nextCell.x > charPos.x then
Tree.level.characters[self.id].graphics.animation.side = RIGHT
end
self:runTo(nextCell)
path:pop_front()
end

View File

@ -30,11 +30,6 @@ function selector:update(dt)
if not characterId and self.id then -- временная обработка события "побежать к точке"
local char = Tree.level.characters[self.id]
local charPos = char.logic.mapLogic.position
if mousePosition.x < charPos.x then
char.graphics.animation.side = LEFT
elseif mousePosition.x > charPos.x then
char.graphics.animation.side = RIGHT
end
local path = (require "lib.pathfinder")(charPos, mousePosition)
path:pop_front()
print("Following path: ")