Compare commits

..

No commits in common. "40afb93d61892ff40f73df5adce0bc040fce5fca" and "ba73d8f3b69b7073f81848bc51806c431b9fb019" have entirely different histories.

5 changed files with 18 additions and 39 deletions

Binary file not shown.

View File

@ -4,30 +4,21 @@ local map = {
{ "-", "_", "w", "w", "-", "-", "-", "-", "-", "-" },
{ "-", "-", "w", "w", "-", "w", "-", "-", "-", "-" },
{ "w", "-", "-", "-", "w", "w", "-", "-", "-", "-" },
{ "w", "-", "ww", "-", "-", "w", "w", "w", "-", "-" },
{ "w", "-", "ww", "-", "-", "w", "-", "-", "-", "-" },
{ "-", "-", "ww", "-", "-", "w", "-", "w", "-", "-" },
{ "w", "-", "w", "-", "-", "w", "w", "w", "-", "-" },
{ "w", "-", "w", "-", "-", "w", "-", "-", "-", "-" },
{ "-", "-", "w", "-", "-", "w", "-", "w", "-", "-" },
{ "-", "-", "-", "-", "-", "-", "-", "w", "-", "-" },
{ "-", "-", "ww", "-", "-", "-", "-", "w", "w", "-" },
{ "-", "-", "ww", "-", "-", "-", "-", "-", "w", "-" }
},
tileset = {
display = { "-", "_", "w", "ww" },
db = { "floor_stone,", "floor_wood", "wall_stone", "wall_wood" }
{ "-", "-", "w", "-", "-", "-", "-", "w", "w", "-" },
{ "-", "-", "w", "-", "-", "-", "-", "-", "w", "-" }
},
mapCrypt = function(self, tile)
for i=1, #self.tileset.display do
if self.tileset.display[i] == tile then
return self.tileset.db[i]
end
if tile == "-" then
return "floor_stone"
elseif tile == "_" then
return "floor_wood"
elseif tile == "w" then
return "wall_stone"
end
--if tile == "-" then
-- return "floor_stone"
--elseif tile == "_" then
-- return "floor_wood"
--elseif tile == "w" then
-- return "wall_stone"
--end
end,
mapDecrypt = function(self, tile)
-- TODO: Rework function so it returns both char and mat type

View File

@ -6,29 +6,19 @@ sqlite3 database.sqlite3 "
x TEXT,
y TEXT,
occupied_by_type TEXT,
occupied_by_id INTEGER,
game_ref INTEGER
occupied_by_id INTEGER
);
CREATE TABLE IF NOT EXISTS entity_ref (
id INTEGER PRIMARY KEY AUTOINCREMENT,
entity_id INTEGER,
type TEXT,
hp INTEGER,
inventory_ref INTEGER,
game_ref INTEGER
inventory_ref INTEGER
);
CREATE TABLE IF NOT EXISTS player_inventory (
id INTEGER PRIMARY KEY AUTOINCREMENT,
type TEXT,
quantity INTEGER,
game_ref INTEGER
);
CREATE TABLE IF NOT EXISTS games (
id INTEGER PRIMARY KEY AUTOINCREMENT,
player_id INTEGER
);
CREATE TABLE IF NOT EXISTS players (
id INTEGER PRIMARY KEY AUTOINCREMENT,
player_name TEXT
func_ref TEXT
)
"

View File

@ -1,10 +1,5 @@
<!DOCTYPE HTML>
<script src="/static/htmx.min.js"></script>
<% if not isPopulated then %>
<div id="clickable">
<button hx-post="/clickme" hx-target="#clickable">Start</button>
</div>
<% end %>
<article>
<p style="text-align: center;">Game</p>
<main style="width: 50%;" class="container" id="map" hx-get="/map/render" hx-trigger="every 1s,load">

View File

@ -6,7 +6,10 @@
</div>
<% end %>
<a href="/game">Play Now</a>
<article>
<p style="text-align: center;">Game</p>
<main style="width: 50%;" class="container" id="map" hx-get="/map/render" hx-trigger="every 1s,load">
</article>
</main>