modules/world: add comment to make structure more explicit

This commit is contained in:
Kazhnuz 2019-04-07 13:22:23 +02:00
parent 696a568d0c
commit 171ff007e9

View file

@ -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)