Add: add time bonus if all meat was welldone

This commit is contained in:
2018-11-02 10:46:12 +09:00
parent 1c42c88f2f
commit 5e12109e40
3 changed files with 22 additions and 2 deletions
+3
View File
@@ -82,6 +82,9 @@ StageTimer.prototype.addTime = function(timeSec) {
} }
StageTimer.prototype.addBonusTime = function(timeSec) { StageTimer.prototype.addBonusTime = function(timeSec) {
if(timeSec == 0)
return;
this.addTime(timeSec); this.addTime(timeSec);
game.world.bringToTop(this.bonusTimeText); game.world.bringToTop(this.bonusTimeText);
+18 -2
View File
@@ -107,6 +107,7 @@ var Game = {
this.gameTimeEvents = []; this.gameTimeEvents = [];
this.meatCount; this.meatCount;
this.badMeatCount = 0;
}, },
@@ -157,6 +158,7 @@ var Game = {
startStage: function() { startStage: function() {
this.clearedMeatCount = 0; this.clearedMeatCount = 0;
this.badMeatCount = 0;
this.activatedMeatCount = this.getStageMeatCount(); this.activatedMeatCount = this.getStageMeatCount();
this.serveMeats(); this.serveMeats();
}, },
@@ -184,8 +186,20 @@ var Game = {
} }
}, },
getScore: function() {
return this.playingStageNo * 10;
},
getBonusTime: function() { getBonusTime: function() {
return this.playingStageNo * 4; if(this.badMeatCount > 0)
return 0;
if(this.playingStageNo == 1)
return 5;
else if(this.playingStageNo == 2)
return 7;
else
return 6 + this.playingStageNo;
}, },
@@ -234,12 +248,14 @@ var Game = {
if(meat.getMeatGrade() == Meat.DONENESS_WELLDONE) { if(meat.getMeatGrade() == Meat.DONENESS_WELLDONE) {
this.god.animateHappy(Meat.DONENESS_WELLDONE); // "맛있어♥♡♥"); this.god.animateHappy(Meat.DONENESS_WELLDONE); // "맛있어♥♡♥");
var score = 10 * this.playingStageNo; var score = this.getScore();
this.scoreManager.plusScore(score); this.scoreManager.plusScore(score);
var tempPlusScore = new PlusScore(this.god.x, this.god.y - 180, score); var tempPlusScore = new PlusScore(this.god.x, this.god.y - 180, score);
this.plusScoreGroup.add(tempPlusScore); this.plusScoreGroup.add(tempPlusScore);
} else { } else {
this.badMeatCount++;
if(meat.getMeatGrade() == Meat.DONENESS_RARE) { if(meat.getMeatGrade() == Meat.DONENESS_RARE) {
this.god.animateAngry(Meat.DONENESS_RARE); // "날고기 싫어!!!"); this.god.animateAngry(Meat.DONENESS_RARE); // "날고기 싫어!!!");
} else { // Meat.DONENESS_BURN_BLACK } else { // Meat.DONENESS_BURN_BLACK
+1
View File
@@ -202,6 +202,7 @@ Meat.prototype.show = function() {
Meat.prototype.hide = function() { Meat.prototype.hide = function() {
this.isActivated = false; this.isActivated = false;
this.alpha = 0; this.alpha = 0;
this.stopCook();
} }
Meat.prototype.startCook = function() { Meat.prototype.startCook = function() {