Fix: ES5 -> ES6 class

This commit is contained in:
2018-05-10 22:49:29 +09:00
parent ead099fc05
commit 14ae4a177f
8 changed files with 84 additions and 58 deletions
+28
View File
@@ -28,6 +28,34 @@ class Game {
let playingAppName = appInfoManager.getAppNameKorean(sessionStorageManager.playingAppName);
screenBottom.printBottomCenterText(playingAppName);
screenBottom.printBottomRightText(sessionStorageManager.playerName);
this.countDown();
}
countDown() {
const style = { font: "bold 200px Arial", fill: "#fff",/* align: "center",*/ boundsAlignH: "center", boundsAlignV: "middle" };
this.countDownText = game.add.text(0, 0, "", style);
this.countDownText.setTextBounds(0, 0, game.world.width, game.world.height);
this.countDownText.stroke = "#333";
this.countDownText.strokeThickness = 50;
this.countDownNumber = 3;
this.tweenCountDown();
}
tweenCountDown() {
console.log(this.countDownNumber);
if(this.countDownNumber === 0)
return;
this.countDownText.text = this.countDownNumber.toString();
this.countDownText.alpha = 1;
let countDownTween = game.add.tween(this.countDownText);
countDownTween.to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
countDownTween.onComplete.add(this.tweenCountDown, this);
this.countDownNumber--;
}