21 lines
718 B
JavaScript
21 lines
718 B
JavaScript
export class SimCommandStartNextWave {
|
|
_simLevel;
|
|
_gdRoot;
|
|
constructor(gdRoot, level) {
|
|
this._gdRoot = gdRoot;
|
|
this._simLevel = level;
|
|
}
|
|
execute() {
|
|
const level = this._simLevel;
|
|
const data = level.gdLevel;
|
|
level.currentWave += 1;
|
|
if (!data.waves[level.currentWave]) {
|
|
level.paused = true;
|
|
return;
|
|
}
|
|
level.nextWaveStep = level.currentStep + this._gdRoot.simulation.waveDuration * this._gdRoot.simulation.stepsPerSecond - 1;
|
|
level.lastEnemySpawnStep = level.currentStep;
|
|
level.enemiesLeftToSpawn = data.waves[level.currentWave].amount;
|
|
}
|
|
}
|
|
//# sourceMappingURL=SimCommandStartNextWave.js.map
|