diff options
-rw-r--r-- | html/broughlike/index.html | 12 |
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, |