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 = {
map_tiles = {
{ "-", "-", "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)
if tile == "-" then
return "floor_stone"
elseif tile == "_" then
return "floor_wood"
elseif tile == "w" then
return "wall_stone"
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">
<title><%= page_title or "My Page" %></title>
<link rel="stylesheet" href="/static/css/pico/pico.min.css" />
<link rel="stylesheet" href="/static/incertitude.css" />
</head>
<body>

View File

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