Fix: stage timer - add bonus time, smoke particle
This commit is contained in:
@@ -3,6 +3,7 @@ function StageTimer(stageTimerSec, onTimeOver) {
|
||||
this.onTimeOver = onTimeOver;
|
||||
|
||||
this.isPaused = false;
|
||||
this.timeLeft = this.stageTimerSec;
|
||||
|
||||
var fontStyle = StageTimer.DEFAULT_TEXT_FONT;
|
||||
|
||||
@@ -22,6 +23,11 @@ function StageTimer(stageTimerSec, onTimeOver) {
|
||||
// this.label.strokeThickness = 3;
|
||||
|
||||
this.timerEvent = null;
|
||||
|
||||
var textStyle = { font: "bold 64px Arial", fill: "#ff0", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
this.bonusTimeText = game.add.text(game.world.centerX, game.world.centerY, "보너스 타임", textStyle);
|
||||
this.bonusTimeText.anchor.set(0.5);
|
||||
this.bonusTimeText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
};
|
||||
|
||||
StageTimer.prototype.start = function() {
|
||||
@@ -67,11 +73,20 @@ StageTimer.prototype.removeTimer = function() {
|
||||
this.timerEvent = null;
|
||||
}
|
||||
|
||||
StageTimer.prototype.add = function(timeSec) {
|
||||
StageTimer.prototype.addTime = function(timeSec) {
|
||||
this.timeLeft += timeSec;
|
||||
this.printTime();
|
||||
}
|
||||
|
||||
StageTimer.prototype.addBonusTime = function(timeSec) {
|
||||
this.addTime(timeSec);
|
||||
|
||||
game.world.bringToTop(this.bonusTimeText);
|
||||
this.bonusTimeText.text = "+" + timeSec + "초 추가";
|
||||
this.bonusTimeText.alpha = 1;
|
||||
game.add.tween(this.bonusTimeText).to({alpha: 0}, Phaser.Timer.SECOND * 1.5, Phaser.Easing.Quintic.In, true);
|
||||
}
|
||||
|
||||
|
||||
StageTimer.FONT_HEIGHT_PX = 70;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user