epervier-old/gamecore/modules/world/baseworld.lua
2019-04-01 13:09:21 +02:00

29 lines
452 B
Lua

local BaseWorld = Object:extend()
function BaseWorld:new(scene)
self.scene = scene
self.actors = {}
end
function BaseWorld:registerActor(actor)
table.insert(self.actors, actor)
end
function BaseWorld:countActors()
return #self.actors
end
function BaseWorld:update(dt)
for i,v in ipairs(self.actors) do
v:update(dt)
end
end
function BaseWorld:draw(dt)
for i,v in ipairs(self.actors) do
v:draw(dt)
end
end
return BaseWorld