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
1 changed files with 9 additions and 1 deletions

View File

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