Compare commits

..

No commits in common. "989d33ff5e92a256e78c34ade3a4facadd3acc12" and "d48ad24c08b74ba850873778ed4e1b65d879161e" have entirely different histories.

7 changed files with 3 additions and 59 deletions

15
app.lua
View File

@ -14,11 +14,7 @@ app.layout = require "views.layout"
app:post("/clickme", function(self) app:post("/clickme", function(self)
self.plane = "P-38L" self.plane = "P-38L"
<<<<<<< HEAD
mapFunc:populate(map)
=======
mapFunc.populate(self, map) mapFunc.populate(self, map)
>>>>>>> refs/remotes/origin/master
return {self.plane, layout = false} return {self.plane, layout = false}
end) end)
@ -29,17 +25,6 @@ app:get("/", function(self)
} }
end) end)
app:match("/map/render", function(self)
self.tiles = {}
for h=1,10 do
self.tiles[h] = {}
for i=1,10 do
self.tiles[h][i] = map:find({x = h, y = i})
end
end
return {render = "map", layout = false}
end)
return app return app

BIN
database.sqlite3 Normal file

Binary file not shown.

View File

@ -1,27 +1,3 @@
<<<<<<< HEAD
local map = {
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", "-"}
},
populate = function(self, map)
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],
=======
local map = { local map = {
populate = function(self, map) populate = function(self, map)
for h=1,100 do for h=1,100 do
@ -30,7 +6,6 @@ local map = {
x = h, x = h,
y = i, y = i,
occupied_by_type = "", occupied_by_type = "",
>>>>>>> refs/remotes/origin/master
occupied_by_id = "" occupied_by_id = ""
}) })
end end

View File

@ -12,8 +12,6 @@ http {
init_by_lua_block { init_by_lua_block {
require "lpeg" require "lpeg"
require "lsqlite3"
lapis = require "lapis"
} }
server { server {

View File

@ -13,8 +13,6 @@ http {
init_by_lua_block { init_by_lua_block {
require "lpeg" require "lpeg"
require "lsqlite3"
lapis = require "lapis"
} }
server { server {

View File

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

View File

@ -1,8 +0,0 @@
<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>