more naming convention
now there are spawn objects! now entity spawns are loaded from level! now entity spawns are saved to level!
This commit is contained in:
15
code/spawn.lua
Normal file
15
code/spawn.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user