refactor(levels): use gamecore updateActors(dt) function in World

This commit is contained in:
Kazhnuz 2019-06-17 12:56:10 +02:00
parent b9c041fbeb
commit 76a1099e2d
1 changed files with 1 additions and 17 deletions

View File

@ -56,27 +56,11 @@ end
function World:update(dt)
self.scene.playermanager:update(dt)
self:updateEntities(dt)
self:updateActors(dt)
self:updateMap(dt)
self.scene.camera:update(dt)
end
function World:updateEntities(dt)
--l,t,w,h = l or 0, t or 0, w or self.width, h or self.height
local visibleThings, len = self.scene.camera:getVisibleEntities()
--table.sort(visibleThings, sortByUpdateOrder)
for i=1, len do
visibleThings[i]:update(dt)
end
self.activeObjects = len
end
function World:updateMap(dt)
self.map:update(dt)
end
-- DRAW FUNCTIONS
-- All function to draw the map, world and entities