Fix: ES5 -> ES6 class
This commit is contained in:
@@ -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--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user