modules/world: load the actorlist inside the world
This commit is contained in:
parent
5365f23c30
commit
19cdf6c3ab
1 changed files with 10 additions and 2 deletions
|
@ -3,12 +3,20 @@ local BaseWorld = Object:extend()
|
||||||
-- INIT FUNCTIONS
|
-- INIT FUNCTIONS
|
||||||
-- All functions to init the world and the map
|
-- All functions to init the world and the map
|
||||||
|
|
||||||
function BaseWorld:new(scene)
|
function BaseWorld:new(scene, actorlist)
|
||||||
self.scene = scene
|
self.scene = scene
|
||||||
|
self.setActorList(actorlist)
|
||||||
self.actors = {}
|
self.actors = {}
|
||||||
end
|
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
|
-- ACTOR MANAGEMENT FUNCTIONS
|
||||||
-- Basic function to handle actors
|
-- Basic function to handle actors
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue