tile coloration based on type

This commit is contained in:
Jonathan 2024-03-19 12:50:59 -05:00
parent d7bc833df7
commit a3efe2369d
5 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@ -1,7 +1,7 @@
local map = { local map = {
map_tiles = { map_tiles = {
{ "-", "-", "w", "w", "-", "-", "-", "-", "-", "-" }, { "-", "-", "w", "w", "-", "-", "-", "-", "-", "-" },
{ "-", "-", "w", "w", "-", "-", "-", "-", "-", "-" }, { "-", "_", "w", "w", "-", "-", "-", "-", "-", "-" },
{ "-", "-", "w", "w", "-", "w", "-", "-", "-", "-" }, { "-", "-", "w", "w", "-", "w", "-", "-", "-", "-" },
{ "w", "-", "-", "-", "w", "w", "-", "-", "-", "-" }, { "w", "-", "-", "-", "w", "w", "-", "-", "-", "-" },
{ "w", "-", "w", "-", "-", "w", "w", "w", "-", "-" }, { "w", "-", "w", "-", "-", "w", "w", "w", "-", "-" },
@ -14,6 +14,8 @@ local map = {
mapCrypt = function(self, tile) mapCrypt = function(self, tile)
if tile == "-" then if tile == "-" then
return "floor_stone" return "floor_stone"
elseif tile == "_" then
return "floor_wood"
elseif tile == "w" then elseif tile == "w" then
return "wall_stone" return "wall_stone"
end end

7
static/incertitude.css Normal file
View File

@ -0,0 +1,7 @@
.wood {
color: brown;
}
.stone {
color: gray;
}

View File

@ -4,6 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title><%= page_title or "My Page" %></title> <title><%= page_title or "My Page" %></title>
<link rel="stylesheet" href="/static/css/pico/pico.min.css" /> <link rel="stylesheet" href="/static/css/pico/pico.min.css" />
<link rel="stylesheet" href="/static/incertitude.css" />
</head> </head>
<body> <body>

View File

@ -2,7 +2,7 @@
<% for h=1,10 do %> <% for h=1,10 do %>
<div class="grid"> <div class="grid">
<% for i=1,10 do %> <% for i=1,10 do %>
<div><%= tiles[h][i].char %></div> <div class="<%= tiles[h][i].material %>"><%= tiles[h][i].char %></div>
<% end %> <% end %>
<br> <br>
</div> </div>