modules/world: load the actorlist inside the world

This commit is contained in:
Kazhnuz 2019-04-07 13:35:49 +02:00
parent 5365f23c30
commit 19cdf6c3ab

View file

@ -3,12 +3,20 @@ local BaseWorld = Object:extend()
-- INIT FUNCTIONS
-- All functions to init the world and the map
function BaseWorld:new(scene)
function BaseWorld:new(scene, actorlist)
self.scene = scene
self.setActorList(actorlist)
self.actors = {}
end
function BaseWorld:setActorList(actorlist)
if actorlist == nil then
error("FATAL: You must set an actorlist to your world")
else
self.obj = require(actorlist)
end
end
-- ACTOR MANAGEMENT FUNCTIONS
-- Basic function to handle actors