Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.

Commit b606999

Browse files
committed
Merge pull request #142 from ninjadev/fix_loading
Fix restarting of game
2 parents b478aed + 9d8df8b commit b606999

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/EnemyController.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ function EnemyController(game) {
44
this.timeLeftOfWave = 0;
55
this.game = game;
66
this.enemies = [];
7+
this.WAVES = WAVES.slice();
78
}
89

910
EnemyController.prototype.nextWave = function(t, cb){
1011
this.waveStartTime = t*20;
1112
this.numberOfWaves++;
1213
this.cb = cb;
13-
if (WAVES.length > 0) {
14-
this.currentWave = WAVES.shift();
14+
if (this.WAVES.length > 0) {
15+
this.currentWave = this.WAVES.shift();
1516
} else {
1617
this.currentWave = {
1718
monsters: Object.keys(this.enemyTypes),

0 commit comments

Comments
 (0)