about summary refs log tree commit diff stats
path: root/html/broughlike
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-10-27 11:59:06 -0400
committerelioat <elioat@tilde.institute>2024-10-27 11:59:06 -0400
commite97b158e6512b2616e756674ab16018b00e440c0 (patch)
tree0d8545f51e077fbd905ca96b66b45b6a017360a8 /html/broughlike
parent07f6f719e065f11c0addc8fc5ace587d40cd445b (diff)
downloadtour-e97b158e6512b2616e756674ab16018b00e440c0.tar.gz
*
Diffstat (limited to 'html/broughlike')
-rw-r--r--html/broughlike/index.html12
1 files changed, 2 insertions, 10 deletions
diff --git a/html/broughlike/index.html b/html/broughlike/index.html
index c530919..e86e022 100644
--- a/html/broughlike/index.html
+++ b/html/broughlike/index.html
@@ -158,16 +158,8 @@
 
             // Generate a boss enemy every ENEMY_BOSS_OCCURRENCE levels
             if (player.score % ENEMY_BOSS_OCCURRENCE === 0 && player.score > 0) {
-                let bossX, bossY;
-                do {
-                    bossX = Math.floor(Math.random() * GRID_SIZE);
-                    bossY = Math.floor(Math.random() * GRID_SIZE);
-                } while (
-                    (bossX === player.x && bossY === player.y) ||
-                    (bossX === exit.x && bossY === exit.y) ||
-                    walls.some(wall => wall.x === bossX && wall.y === bossY) ||
-                    enemies.some(enemy => enemy.x === bossX && enemy.y === bossY)
-                );
+                let bossX = exit.x; // Boss enemies always appear at the exit
+                let bossY = exit.y; // This ensures that they're not in little rooms that the player can't reach
                 enemies.push({
                     isBoss: true,
                     color: COLORS.boss,