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:
lustlion
2022-03-08 09:34:51 +01:00
parent a8ffae726f
commit 0acbfd5e9d
24 changed files with 165 additions and 139 deletions

View File

@@ -18,14 +18,23 @@ function loadLevelTiles()
indexLevelTiles()
createTileObjects()
createRoomObjects()
getSpawns()
end
function createRoomObjects()
LoadedObjects.Rooms = {}
for _, v in pairs(LevelData.objects.rooms) do
table.insert(LoadedObjects.Rooms, Collision:new(v[1][1],v[1][2],v[2][1],v[2][2]))
end
end
function getSpawns()
LoadedObjects.Spawns = {}
for _, v in pairs(LevelData.objects.spawns) do
addSpawn(v[1],unpack(v[2]))
end
end
function expandLevelCanvas(horizontal,vertical)
local horizontal = horizontal or 0
local vertical = vertical or 0