added real-time map render!

This commit is contained in:
2024-03-18 15:31:53 -05:00
parent 0d9e48752d
commit 684ebb61a8
9 changed files with 79 additions and 6 deletions

View File

@ -1,11 +1,15 @@
<!-- views/index.etlua -->
<script src="/static/htmx.min.js"></script>
<div id="clickable">
<button hx-post="/clickme" hx-target="#clickable">Start</button>
</div>
<button hx-post="/clickme" hx-target="#clickable">Start</button>
<p id="clickable"></p>
<div id="map" hx-get="/map/render" hx-trigger="every 5s">
</div>
<ol>
<!--
<ol>
<p><% for i, thing in pairs(text) do %>
<li><%= thing %></li>
<% end %>

8
views/map.etlua Normal file
View File

@ -0,0 +1,8 @@
<p style="text-align: center;">
<% for h=1,10 do %>
<% for i=1,10 do %>
<%= tiles[h][i].occupied_by_type %>
<% end %>
<br>
<% end %>
</p>