Add: AlienGroup

This commit is contained in:
2018-05-12 06:26:15 +09:00
parent bca20b33c1
commit 5e88d510f9
2 changed files with 13 additions and 7 deletions
+9 -3
View File
@@ -21,11 +21,17 @@ class Game {
// contents
let alien = new Alien(100, 150, this.onAlienFired, this.onAlienEscaped);
alien.goWaitingRoom();
this.alienGroup = game.add.group();
this.alienGroup.inputEnableChildren = true;
for(let i = 0; i < 10; i++) {
let alien = new Alien(150 + 80 * i, 150, this.onAlienFired, this.onAlienFired);
alien.goWaitingRoom();
alien.setActive(false);
this.alienGroup.add(alien);
}
// activate first alien
alien.setActive(true);
// this.alienGroup[0].setActive(true);
// bottom