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)
self.plane = "P-38L"
<<<<<<< HEAD
mapFunc:populate(map)
=======
mapFunc.populate(self, map)
>>>>>>> refs/remotes/origin/master
return {self.plane, layout = false}
end)
@ -29,17 +25,6 @@ app:get("/", function(self)
}
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

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

View File

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

View File

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

View File

@ -1,15 +1,11 @@
<!-- views/index.etlua -->
<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>
<!--
<p><% for i, thing in pairs(text) do %>
<li><%= thing %></li>
<% 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>