From e97b158e6512b2616e756674ab16018b00e440c0 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 27 Oct 2024 11:59:06 -0400 Subject: * --- html/broughlike/index.html | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'html/broughlike') 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, -- cgit 1.4.1-2-gfad0