feat: add ysorting to battlesystem
This commit is contained in:
parent
a67d1f0824
commit
daae72dd8a
1 changed files with 1 additions and 0 deletions
|
@ -96,6 +96,7 @@ function World:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
function World:drawActors()
|
function World:drawActors()
|
||||||
|
table.sort(self.actors, function(a, b) return (a.y < b.y) end)
|
||||||
for i, actor in ipairs(self.actors) do
|
for i, actor in ipairs(self.actors) do
|
||||||
actor:draw()
|
actor:draw()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue