Add: ScoreText
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user