about summary refs log tree commit diff stats
path: root/js/puzzle-dungeon/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'js/puzzle-dungeon/index.html')
-rw-r--r--js/puzzle-dungeon/index.html28
1 files changed, 24 insertions, 4 deletions
diff --git a/js/puzzle-dungeon/index.html b/js/puzzle-dungeon/index.html
index ed13d3d..c183ea0 100644
--- a/js/puzzle-dungeon/index.html
+++ b/js/puzzle-dungeon/index.html
@@ -6,19 +6,39 @@
     <style>
         canvas {
             border: 1px solid black;
+            display: block;
+            margin: 0 auto;
         }
     </style>
 </head>
 <body>
-    <canvas id="gameCanvas" width="500" height="500"></canvas>
+    <canvas id="gameCanvas"></canvas>
     <form id="commandForm">
         <textarea id="commands" rows="10" cols="30"></textarea><br>
         <button type="submit">Submit</button>
     </form>
+    <div id="playerStatus">
+        <h3>Player Status</h3>
+        <p id="playerPosition">Position: (0, 0)</p>
+        <p id="playerHealth">Health: 10</p>
+        <p id="playerEndurance">Endurance: 10</p>
+        <p id="playerInventory">Inventory: []</p>
+        <p id="playerScore">Score: 0</p>
+    </div>
     <script type="module">
-    import './parser.js';
-    import './commandHandler.js';
-    import './game.js';
+        import { parseCommands } from './parser.js';
+        import { initializeGame, resizeCanvas } from './game.js';
+
+        document.getElementById('commandForm').addEventListener('submit', function(event) {
+            event.preventDefault();
+            const commands = document.getElementById('commands').value;
+            parseCommands(commands);
+        });
+
+        window.addEventListener('resize', resizeCanvas);
+
+        // Initialize the game
+        initializeGame();
     </script>
 </body>
 </html>