mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-24 10:48:46 +00:00
Movement settings
This commit is contained in:
parent
fbd201fb44
commit
6cced4ecfc
@ -64,6 +64,7 @@
|
||||
"cooldown": 5,
|
||||
"enemiesPerWave": 30,
|
||||
"waveLifetime": 20,
|
||||
"enemyMoveType": "Launch",
|
||||
"enemyType": "Basic"
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,6 @@ export class WaveEnemySpawnerSettings {
|
||||
public cooldown = 0;
|
||||
public enemiesPerWave = 0;
|
||||
public waveLifetime = 0;
|
||||
public moveType = "";
|
||||
public enemyMoveType = "";
|
||||
public enemyType = "";
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export class WaveEnemySpawner {
|
||||
this.spawnTimer = new GameTimer(settings.cooldown);
|
||||
this.enemiesPerWave = settings.enemiesPerWave;
|
||||
this.waveLifetime = settings.waveLifetime;
|
||||
this.moveType = <EnemyMovementType>settings.moveType;
|
||||
this.moveType = <EnemyMovementType>settings.enemyMoveType;
|
||||
this.enemyType = <EnemyType>settings.enemyType;
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ export class WaveEnemySpawner {
|
||||
const randomOffsetY: number = randomRange(-20, 20);
|
||||
const posX: number = defaultPosX + randomOffsetX + 50 * (i % side);
|
||||
const posY: number = defaultPosY + randomOffsetY + 50 * Math.floor(i / side);
|
||||
const enemy = this.enemySpawner.spawnNewEnemy(posX, posY, EnemyMovementType.Launch);
|
||||
const enemy = this.enemySpawner.spawnNewEnemy(posX, posY, this.moveType);
|
||||
enemies.push(enemy);
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,8 @@ function deleteUnusedProperties(templateSettings: GameSettings, savedSettings: G
|
||||
}
|
||||
|
||||
function getAllKeys(objectWithKeys: any, prefix = ""): string[] {
|
||||
if (typeof objectWithKeys === "string") return [];
|
||||
|
||||
const keys: string[] = [];
|
||||
const objectKeys: string[] = Object.keys(objectWithKeys);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user