From 63238c4ec6f73c0c74172f94da42e4fc21e86e98 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 7 Apr 2019 13:46:08 +0200 Subject: [PATCH] modules/world: add a function to add Actor from index --- gamecore/modules/world/baseworld.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamecore/modules/world/baseworld.lua b/gamecore/modules/world/baseworld.lua index 8c46653..2f91ecf 100644 --- a/gamecore/modules/world/baseworld.lua +++ b/gamecore/modules/world/baseworld.lua @@ -20,6 +20,10 @@ end -- ACTOR MANAGEMENT FUNCTIONS -- Basic function to handle actors +function BaseWorld:newActor(name, x, y) + self.obj.index[name](self, x, y) +end + function BaseWorld:registerActor(actor) table.insert(self.actors, actor) end