Add: alien
This commit is contained in:
@@ -19,6 +19,13 @@ class Game {
|
||||
|
||||
|
||||
// contents
|
||||
let alien = new Alien(
|
||||
this.game.world.width / 2, this.game.world.height / 2,
|
||||
this.onAlienFired, this.onAlienEscaped
|
||||
);
|
||||
alien.setActive(true);
|
||||
alien.moveOnStage();
|
||||
/*
|
||||
let alien = game.add.sprite(this.game.world.width / 2, this.game.world.height / 2, 'alien_normal');
|
||||
alien.anchor.set(0.5);
|
||||
alien.scale.set(0);
|
||||
@@ -28,6 +35,8 @@ class Game {
|
||||
// alienTween.yoyo(true, 3000);
|
||||
alienTween.to( { x: 4, y: 4 }, 1000, Phaser.Easing.Linear.None, false);
|
||||
alienTween.start();
|
||||
*/
|
||||
|
||||
|
||||
// bottom
|
||||
let screenBottom = new ScreenBottom(game);
|
||||
@@ -76,4 +85,13 @@ class Game {
|
||||
console.log("startGame");
|
||||
}
|
||||
|
||||
onAlienFired(sprite) {
|
||||
console.log("onAlienFired");
|
||||
sprite.moveOnStage();
|
||||
}
|
||||
|
||||
onAlienEscaped(sprite) {
|
||||
console.log("onAlienEscaped");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user