Add: add bonus time to card matching

This commit is contained in:
2018-11-02 10:29:07 +09:00
parent 5f82d6ccae
commit 1c42c88f2f
3 changed files with 15 additions and 8 deletions
+7 -4
View File
@@ -24,9 +24,12 @@ function StageTimer(stageTimerSec, onTimeOver) {
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);
var textStyle = { font: "bold 52px Arial", fill: "#ffd700", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
this.bonusTimeText = game.add.text(game.world.centerX, game.world.centerY, "", textStyle);
this.bonusTimeText.alpha = 0;
this.bonusTimeText.anchor.set(0.5);
this.bonusTimeText.stroke = '#000';
this.bonusTimeText.strokeThickness = 6;
this.bonusTimeText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
};
@@ -82,9 +85,9 @@ StageTimer.prototype.addBonusTime = function(timeSec) {
this.addTime(timeSec);
game.world.bringToTop(this.bonusTimeText);
this.bonusTimeText.text = "+" + timeSec + "초 추가";
this.bonusTimeText.text = "시간 보너스\n+" + timeSec + "초 추가";
this.bonusTimeText.alpha = 1;
game.add.tween(this.bonusTimeText).to({alpha: 0}, Phaser.Timer.SECOND * 1.5, Phaser.Easing.Quintic.In, true);
game.add.tween(this.bonusTimeText).to({alpha: 0}, Phaser.Timer.SECOND, Phaser.Easing.Quintic.In, true);
}
+7 -2
View File
@@ -474,8 +474,11 @@ var Game = {
checkStageCleared: function() {
this.clearedCardCount += 2;
if(this.activatedCardCount == this.clearedCardCount)
if(this.activatedCardCount == this.clearedCardCount) {
this.stageTimer.addBonusTime(this.getBonusTime());
this.startNextStage();
}
},
resetDifferentTwoCards: function() {
@@ -532,7 +535,9 @@ var Game = {
return this.playingStageNo * 10;
},
getBonusTime: function() {
return this.playingStageNo;
},
gameOver: function() {
+1 -2
View File
@@ -255,8 +255,7 @@ var Game = {
},
clearStage: function() {
var bonusTime = this.getBonusTime();
this.stageTimer.addBonusTime(bonusTime);
this.stageTimer.addBonusTime(this.getBonusTime());
this.playingStageNo++;