modules/world: separate actors functions from main functions
This commit is contained in:
parent
9a47584feb
commit
064d5bd2a8
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue