restored mapCrypt looping

This commit is contained in:
2024-03-20 15:29:00 -05:00
parent ba73d8f3b6
commit eb8db81789
3 changed files with 26 additions and 15 deletions

View File

@ -4,21 +4,30 @@ local map = {
{ "-", "_", "w", "w", "-", "-", "-", "-", "-", "-" },
{ "-", "-", "w", "w", "-", "w", "-", "-", "-", "-" },
{ "w", "-", "-", "-", "w", "w", "-", "-", "-", "-" },
{ "w", "-", "w", "-", "-", "w", "w", "w", "-", "-" },
{ "w", "-", "w", "-", "-", "w", "-", "-", "-", "-" },
{ "-", "-", "w", "-", "-", "w", "-", "w", "-", "-" },
{ "w", "-", "ww", "-", "-", "w", "w", "w", "-", "-" },
{ "w", "-", "ww", "-", "-", "w", "-", "-", "-", "-" },
{ "-", "-", "ww", "-", "-", "w", "-", "w", "-", "-" },
{ "-", "-", "-", "-", "-", "-", "-", "w", "-", "-" },
{ "-", "-", "w", "-", "-", "-", "-", "w", "w", "-" },
{ "-", "-", "w", "-", "-", "-", "-", "-", "w", "-" }
{ "-", "-", "ww", "-", "-", "-", "-", "w", "w", "-" },
{ "-", "-", "ww", "-", "-", "-", "-", "-", "w", "-" }
},
tileset = {
display = { "-", "_", "w", "ww" },
db = { "floor_stone,", "floor_wood", "wall_stone", "wall_wood" }
},
mapCrypt = function(self, tile)
if tile == "-" then
return "floor_stone"
elseif tile == "_" then
return "floor_wood"
elseif tile == "w" then
return "wall_stone"
for i=1, #self.tileset.display do
if self.tileset.display[i] == tile then
return self.tileset.db[i]
end
end
--if tile == "-" then
-- return "floor_stone"
--elseif tile == "_" then
-- return "floor_wood"
--elseif tile == "w" then
-- return "wall_stone"
--end
end,
mapDecrypt = function(self, tile)
-- TODO: Rework function so it returns both char and mat type