From 9fdf2ebdd7d6b0cb09a7f9874c46e82feb9fb356 Mon Sep 17 00:00:00 2001 From: elioat <{ID}+{username}@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:22:48 -0400 Subject: * --- html/broughlike/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'html/broughlike') 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(); } } -- cgit 1.4.1-2-gfad0