diff --git a/gamecore/modules/world/baseworld.lua b/gamecore/modules/world/baseworld.lua index 8b62e1b..8068062 100644 --- a/gamecore/modules/world/baseworld.lua +++ b/gamecore/modules/world/baseworld.lua @@ -1,11 +1,17 @@ local BaseWorld = Object:extend() +-- INIT FUNCTIONS +-- All functions to init the world and the map + function BaseWorld:new(scene) self.scene = scene self.actors = {} end +-- ACTOR MANAGEMENT FUNCTIONS +-- Basic function to handle actors + function BaseWorld:registerActor(actor) table.insert(self.actors, actor) end @@ -14,12 +20,18 @@ function BaseWorld:countActors() return #self.actors end +-- UPDATE FUNCTIONS +-- All update functions + function BaseWorld:update(dt) for i,v in ipairs(self.actors) do v:update(dt) end end +-- DRAW FUNCTIONS +-- All function to draw the map, world and actors + function BaseWorld:draw(dt) for i,v in ipairs(self.actors) do v:draw(dt)