modules/world: separate actors functions from main functions

This commit is contained in:
Kazhnuz 2019-04-07 14:06:04 +02:00
parent 9a47584feb
commit 064d5bd2a8

View file

@ -114,6 +114,10 @@ end
function BaseWorld:update(dt) function BaseWorld:update(dt)
self:updateMap(dt) self:updateMap(dt)
self:updateActors(dt)
end
function BaseWorld:updateActors(dt)
for i,v in ipairs(self.actors) do for i,v in ipairs(self.actors) do
v:update(dt) v:update(dt)
end end
@ -132,8 +136,12 @@ end
function BaseWorld:draw(dt) function BaseWorld:draw(dt)
self:drawBackgroundColor() self:drawBackgroundColor()
self:drawMap() self:drawMap()
self:drawActors()
end
function BaseWorld:drawActors()
for i,v in ipairs(self.actors) do for i,v in ipairs(self.actors) do
v:draw(dt) v:draw()
end end
end end