about summary refs log tree commit diff stats
path: root/html/broughlike/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/broughlike/index.html')
-rw-r--r--html/broughlike/index.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/html/broughlike/index.html b/html/broughlike/index.html
index 9b6a088..b318def 100644
--- a/html/broughlike/index.html
+++ b/html/broughlike/index.html
@@ -118,7 +118,9 @@
             totalDamageTaken: 0,
             cellsTraveled: 0,
             killCount: 0,
-            itemsCollected: 0
+            itemsCollected: 0,
+            lineSegments: 0,
+            inventory: []
         };
 
         const exit = { x: Math.floor(Math.random() * GRID_SIZE), y: Math.floor(Math.random() * GRID_SIZE) };
@@ -724,7 +726,12 @@
 
             if (enemy.health <= 0) {
                 player.killCount++;
-                enemies = enemies.filter(e => e !== enemy);
+                enemies = enemies.filter(e => e !== enemy);                
+                if (enemy.isBoss) {
+                    player.lineSegments += 2;
+                } else {
+                    player.lineSegments++;
+                }
             }
 
             if (player.health <= 0) {
@@ -753,6 +760,8 @@
             player.itemsCollected = 0;
             player.x = 0;
             player.y = 0;
+            player.lineSegments = 0;
+            player.inventory = [];
             combatDots = {};
             generateExit();
             generateEnemies();