diff options
-rw-r--r-- | html/broughlike/index.html | 6 |
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(); } } |