about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--html/broughlike/index.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/html/broughlike/index.html b/html/broughlike/index.html
index 335fa89..9afeb07 100644
--- a/html/broughlike/index.html
+++ b/html/broughlike/index.html
@@ -43,6 +43,7 @@
         const PLAYER_MAX_HEALTH = 12;
         const PLAYER_BASE_DAMAGE = 1;
         const ENEMY_CHASE_DISTANCE = 4;
+        const MAX_ENEMIES_ON_LEVEL = 4;
         const MAX_ENEMY_HEALTH = 7;
         const MIN_ENEMY_HEALTH = 2;
         const WALLS_MIN = 5;
@@ -91,7 +92,7 @@
 
         function generateEnemies() {
             enemies = [];
-            const numEnemies = Math.floor(Math.random() * 3); // Between 0 and 2 enemies, FIXME consider making this a tunable constant
+            const numEnemies = Math.floor(Math.random() * (MAX_ENEMIES_ON_LEVEL + 1)); // Between 0 and the constant value.
             for (let i = 0; i < numEnemies; i++) {
                 let enemyX, enemyY;
                 do {