Files
HexTowerDefense/dist/Simulation/Commands/SimCommandStartNextWave.js
2026-04-19 01:16:27 +02:00

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