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