refactor(levels): use gamecore updateActors(dt) function in World
This commit is contained in:
parent
b9c041fbeb
commit
76a1099e2d
|
@ -56,27 +56,11 @@ end
|
||||||
|
|
||||||
function World:update(dt)
|
function World:update(dt)
|
||||||
self.scene.playermanager:update(dt)
|
self.scene.playermanager:update(dt)
|
||||||
self:updateEntities(dt)
|
self:updateActors(dt)
|
||||||
self:updateMap(dt)
|
self:updateMap(dt)
|
||||||
self.scene.camera:update(dt)
|
self.scene.camera:update(dt)
|
||||||
end
|
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
|
-- DRAW FUNCTIONS
|
||||||
-- All function to draw the map, world and entities
|
-- All function to draw the map, world and entities
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue