Mothback/code/spawn.lua
lustlion 0acbfd5e9d more naming convention
now there are spawn objects!
now entity spawns are loaded from level!
now entity spawns are saved to level!
2022-03-08 09:34:51 +01:00

16 lines
287 B
Lua

LoadedObjects.Spawns = {}
function addSpawn(archetype, ...)
local o = {
archetype = archetype,
args = {...}
}
table.insert(LoadedObjects.Spawns, o)
end
function activateSpawns()
for _, spawn in pairs(LoadedObjects.Spawns) do
spawn.archetype:new(unpack(spawn.args))
end
end