mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-26 11:48:54 +00:00
Circular spawner distance
This commit is contained in:
parent
01e33c003b
commit
7e50e5c672
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user