expanded tile descript in DB

This commit is contained in:
2024-03-18 19:38:28 -05:00
parent 6b371066d4
commit 066ce2aaaa
4 changed files with 27 additions and 3 deletions

View File

@ -11,13 +11,27 @@ local map = {
{"-", "-", "w", "-", "-", "-", "-", "w", "w", "-"},
{"-", "-", "w", "-", "-", "-", "-", "-", "w", "-"}
},
mapCrypt = function(self, tile)
if tile == "-" then
return "floor_stone"
elseif tile == "w" then
return "wall_stone"
end
end,
mapDecrypt = function(self, tile)
if tile == "floor_stone" then
return "-"
elseif tile == "wall_stone" then
return "w"
end
end,
populate = function(self, map)
for h=1,10 do
for h=1,10 do
for i=1,10 do
local tile = map:create({
x = h,
y = i,
occupied_by_type = self.map_tiles[h][i],
occupied_by_type = self:mapCrypt(self.map_tiles[h][i]),
occupied_by_id = ""
})
end
@ -48,3 +62,4 @@ return map