Circular spawner distance

This commit is contained in:
Martin 2022-12-13 18:30:43 +01:00
parent 01e33c003b
commit 7e50e5c672

View File

@ -25,8 +25,8 @@ export class CircularEnemySpawner extends DelayedEnemySpawner {
const angle: number = (2 * Math.PI) / this.enemiesToSpawn; const angle: number = (2 * Math.PI) / this.enemiesToSpawn;
for (let i = 0; i < this.enemiesToSpawn; i++) { for (let i = 0; i < this.enemiesToSpawn; i++) {
const posX: number = roundToOneDecimal(Math.sin(angle * i)) * 700; const posX: number = roundToOneDecimal(Math.sin(angle * i)) * 600;
const posY: number = roundToOneDecimal(Math.cos(angle * i)) * 700; const posY: number = roundToOneDecimal(Math.cos(angle * i)) * 600;
this.enemySpawner.spawnNewEnemy(posX, posY, this.enemyId); this.enemySpawner.spawnNewEnemy(posX, posY, this.enemyId);
} }
} }