From 3d01d0045106dc5d1273326734400be4d5174138 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 7 Jul 2024 16:00:40 -0400 Subject: * --- js/puzzle-dungeon/game.js | 4 +++- js/puzzle-dungeon/index.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/puzzle-dungeon/game.js b/js/puzzle-dungeon/game.js index d80c28f..8a6acf7 100644 --- a/js/puzzle-dungeon/game.js +++ b/js/puzzle-dungeon/game.js @@ -141,6 +141,7 @@ export function initializeGame() { player.power = 10; } + player.par = 0; // always reset player par to 0 player.position = { x: 0, y: 0 }; // player always starts at 0,0 player.steps = 0; // steps are counted per-level player.didScan = false; // scans are counted per-level @@ -166,6 +167,7 @@ export function updatePlayerPosition(newX, newY) { } export function updatePlayerStatus() { + document.getElementById('par').textContent = `Par: ${player.par} : ${levelPar}`; document.getElementById('playerPosition').textContent = `Position: (${player.position.x}, ${player.position.y})`; document.getElementById('playerHealth').textContent = `Health: ${player.health}`; document.getElementById('playerPower').textContent = `Power: ${player.power}`; @@ -206,7 +208,7 @@ function checkForDamageOrTarget() { } export function alertGameOver() { - const gameStatsString = `Level: ${player.level}, Health: ${player.health}, Power: ${player.power}`; + const gameStatsString = `Level: ${player.level}, Par: ${player.par} : ${levelPar}, Health: ${player.health}, Power: ${player.power}`; alert('You have lost the game!' + '\n' + gameStatsString); initializeGame(); } diff --git a/js/puzzle-dungeon/index.html b/js/puzzle-dungeon/index.html index 65138a6..c7d1b45 100644 --- a/js/puzzle-dungeon/index.html +++ b/js/puzzle-dungeon/index.html @@ -51,18 +51,20 @@