modules/world: add comment to make structure more explicit
This commit is contained in:
parent
696a568d0c
commit
171ff007e9
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue