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", "-", "w", "-", "-", "-", "-" },
{ "w", "-", "-", "-", "w", "w", "-", "-", "-", "-" }, { "w", "-", "-", "-", "w", "w", "-", "-", "-", "-" },
{ "w", "-", "ww", "-", "-", "w", "w", "w", "-", "-" }, { "w", "-", "w", "-", "-", "w", "w", "w", "-", "-" },
{ "w", "-", "ww", "-", "-", "w", "-", "-", "-", "-" }, { "w", "-", "w", "-", "-", "w", "-", "-", "-", "-" },
{ "-", "-", "ww", "-", "-", "w", "-", "w", "-", "-" }, { "-", "-", "w", "-", "-", "w", "-", "w", "-", "-" },
{ "-", "-", "-", "-", "-", "-", "-", "w", "-", "-" }, { "-", "-", "-", "-", "-", "-", "-", "w", "-", "-" },
{ "-", "-", "ww", "-", "-", "-", "-", "w", "w", "-" }, { "-", "-", "w", "-", "-", "-", "-", "w", "w", "-" },
{ "-", "-", "ww", "-", "-", "-", "-", "-", "w", "-" } { "-", "-", "w", "-", "-", "-", "-", "-", "w", "-" }
},
tileset = {
display = { "-", "_", "w", "ww" },
db = { "floor_stone,", "floor_wood", "wall_stone", "wall_wood" }
}, },
mapCrypt = function(self, tile) mapCrypt = function(self, tile)
for i=1, #self.tileset.display do if tile == "-" then
if self.tileset.display[i] == tile then return "floor_stone"
return self.tileset.db[i] elseif tile == "_" then
end return "floor_wood"
elseif tile == "w" then
return "wall_stone"
end end
--if tile == "-" then
-- return "floor_stone"
--elseif tile == "_" then
-- return "floor_wood"
--elseif tile == "w" then
-- return "wall_stone"
--end
end, end,
mapDecrypt = function(self, tile) mapDecrypt = function(self, tile)
-- TODO: Rework function so it returns both char and mat type -- TODO: Rework function so it returns both char and mat type

View File

@ -6,29 +6,19 @@ sqlite3 database.sqlite3 "
x TEXT, x TEXT,
y TEXT, y TEXT,
occupied_by_type TEXT, occupied_by_type TEXT,
occupied_by_id INTEGER, occupied_by_id INTEGER
game_ref INTEGER
); );
CREATE TABLE IF NOT EXISTS entity_ref ( CREATE TABLE IF NOT EXISTS entity_ref (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
entity_id INTEGER, entity_id INTEGER,
type TEXT, type TEXT,
hp INTEGER, hp INTEGER,
inventory_ref INTEGER, inventory_ref INTEGER
game_ref INTEGER
); );
CREATE TABLE IF NOT EXISTS player_inventory ( CREATE TABLE IF NOT EXISTS player_inventory (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
type TEXT, type TEXT,
quantity INTEGER, quantity INTEGER,
game_ref INTEGER func_ref TEXT
);
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
) )
" "

View File

@ -1,10 +1,5 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<script src="/static/htmx.min.js"></script> <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> <article>
<p style="text-align: center;">Game</p> <p style="text-align: center;">Game</p>
<main style="width: 50%;" class="container" id="map" hx-get="/map/render" hx-trigger="every 1s,load"> <main style="width: 50%;" class="container" id="map" hx-get="/map/render" hx-trigger="every 1s,load">

View File

@ -6,7 +6,10 @@
</div> </div>
<% end %> <% 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> </main>