Add: ScoreText

This commit is contained in:
2018-05-13 14:38:28 +09:00
parent f2cce23d9b
commit b720f940ec
4 changed files with 48 additions and 4 deletions
+3 -3
View File
@@ -94,10 +94,10 @@ class Alien extends Phaser.Sprite {
}
onFired() {
this.goRandomPosition();
if(typeof this.onFiredFunction !== "undefined")
this.onFiredFunction();
this.onFiredFunction(this);
this.goRandomPosition();
}
goRandomPosition() {
+3 -1
View File
@@ -89,8 +89,10 @@ class Game {
this.activatedAlienIndex++;
}
onAlienFired() {
onAlienFired(sprite) {
console.log("onAlienFired");
console.log("x : " + sprite.x + ", y : " + sprite.y);
let scoreText = new ScoreText(sprite.x, sprite.y, 30);
}
onAlienEscaped() {