пупупу... ой, то есть pupupu...
try to fix side draw (after initial side draw)
This commit is contained in:
parent
541c692f82
commit
7753413385
@ -24,7 +24,15 @@ end
|
|||||||
function logic:followPath(path)
|
function logic:followPath(path)
|
||||||
if path:is_empty() then return end
|
if path:is_empty() then return end
|
||||||
self.mapLogic.path = path;
|
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()
|
path:pop_front()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -30,11 +30,6 @@ function selector:update(dt)
|
|||||||
if not characterId and self.id then -- временная обработка события "побежать к точке"
|
if not characterId and self.id then -- временная обработка события "побежать к точке"
|
||||||
local char = Tree.level.characters[self.id]
|
local char = Tree.level.characters[self.id]
|
||||||
local charPos = char.logic.mapLogic.position
|
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)
|
local path = (require "lib.pathfinder")(charPos, mousePosition)
|
||||||
path:pop_front()
|
path:pop_front()
|
||||||
print("Following path: ")
|
print("Following path: ")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user