about summary refs log tree commit diff stats
path: root/html/broughlike
diff options
context:
space:
mode:
authorelioat <{ID}+{username}@users.noreply.github.com>2024-10-21 10:22:48 -0400
committerelioat <{ID}+{username}@users.noreply.github.com>2024-10-21 10:22:48 -0400
commit9fdf2ebdd7d6b0cb09a7f9874c46e82feb9fb356 (patch)
treea4f89995ed5261c792f45bed9bd3116d5ec399e1 /html/broughlike
parent40fa780d934ec61862804d16a85cb9399d2c312b (diff)
downloadtour-9fdf2ebdd7d6b0cb09a7f9874c46e82feb9fb356.tar.gz
*
Diffstat (limited to 'html/broughlike')
-rw-r--r--html/broughlike/index.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/html/broughlike/index.html b/html/broughlike/index.html
index ef547e7..34e40e2 100644
--- a/html/broughlike/index.html
+++ b/html/broughlike/index.html
@@ -64,7 +64,8 @@
             damage: PLAYER_BASE_DAMAGE,
             totalDamageDone: 0,
             totalDamageTaken: 0,
-            cellsTraveled: 0
+            cellsTraveled: 0,
+            killCount: 0
         };
 
         const exit = { x: Math.floor(Math.random() * GRID_SIZE), y: Math.floor(Math.random() * GRID_SIZE) };
@@ -400,11 +401,12 @@
             console.log("Player hit! Enemy health: " + enemy.health);
 
             if (enemy.health <= 0) {
+                player.killCount++;
                 enemies = enemies.filter(e => e !== enemy);
             }
 
             if (player.health <= 0) {
-                alert(`Dead\n\nScore: ${player.score}\nDistance Traveled: ${player.cellsTraveled}\nTotal Damage Dealt: ${player.totalDamageDone}\nTotal Damage Received: ${player.totalDamageTaken}`);
+                alert(`Dead\n\nScore: ${player.score}\nDistance Traveled: ${player.cellsTraveled}\nTotal Damage Dealt: ${player.totalDamageDone}\nTotal Damage Received: ${player.totalDamageTaken}\nEnemies Vanquished: ${player.killCount}`);
                 resetGame();
             }
         }