diff options
author | elioat <hi@eli.li> | 2024-10-21 11:16:59 -0400 |
---|---|---|
committer | elioat <hi@eli.li> | 2024-10-21 11:16:59 -0400 |
commit | 8aa57714f30a29558e949bd7b52c0ea9cafec1fb (patch) | |
tree | c40fd872d73628b830ef6850132abf920c77b1e7 /html/broughlike | |
parent | 0869a24d9ad412b1f6360de5cf7f318521966815 (diff) | |
download | tour-8aa57714f30a29558e949bd7b52c0ea9cafec1fb.tar.gz |
*
Diffstat (limited to 'html/broughlike')
-rw-r--r-- | html/broughlike/index.html | 8 |
1 files changed, 6 insertions, 2 deletions
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(); |