From 8aa57714f30a29558e949bd7b52c0ea9cafec1fb Mon Sep 17 00:00:00 2001 From: elioat Date: Mon, 21 Oct 2024 11:16:59 -0400 Subject: * --- html/broughlike/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'html/broughlike') diff --git a/html/broughlike/index.html b/html/broughlike/index.html index 2d09c92..e643527 100644 --- a/html/broughlike/index.html +++ b/html/broughlike/index.html @@ -65,7 +65,8 @@ totalDamageDone: 0, totalDamageTaken: 0, cellsTraveled: 0, - killCount: 0 + killCount: 0, + itemsCollected: 0 }; const exit = { x: Math.floor(Math.random() * GRID_SIZE), y: Math.floor(Math.random() * GRID_SIZE) }; @@ -299,6 +300,7 @@ function handleItemCollection() { const collectedItem = items.find(item => item.x === player.x && item.y === player.y); if (collectedItem) { + player.itemsCollected++; if (collectedItem.type === 'diamond') { player.damage += 3; console.log("Collected diamond! +3 damage on this level."); @@ -406,7 +408,7 @@ } if (player.health <= 0) { - alert(`Dead\n\nScore: ${player.score}\nDistance Traveled: ${player.cellsTraveled}\nTotal Damage Dealt: ${player.totalDamageDone}\nTotal Damage Received: ${player.totalDamageTaken}\nCircles Vanquished: ${player.killCount}`); + alert(`Dead\n\nScore: ${player.score}\nDistance Traveled: ${player.cellsTraveled}\nTotal Damage Dealt: ${player.totalDamageDone}\nTotal Damage Received: ${player.totalDamageTaken}\nCircles Vanquished: ${player.killCount}\nItems Collected: ${player.itemsCollected}`); resetGame(); } } @@ -420,6 +422,7 @@ player.cellsTraveled = 0; player.score = 0; player.killCount = 0; + player.itemsCollected = 0; player.x = 0; player.y = 0; combatDots = {}; @@ -441,6 +444,7 @@ console.log("Total Damage Dealt: " + player.totalDamageDone); console.log("Total Damage Received: " + player.totalDamageTaken); console.log("Circles Vanquished: " + player.killCount); + console.log("Items Collected: " + player.itemsCollected); console.groupEnd(); combatDots = {}; generateExit(); -- cgit 1.4.1-2-gfad0