Add: trash can eats burned black meat
This commit is contained in:
@@ -239,7 +239,7 @@ var Game = {
|
||||
return true;
|
||||
},
|
||||
|
||||
isOverGod: function(x, y, width, height) {
|
||||
isOverGod: function(x, y) {
|
||||
// console.log("isOverGod : " + x + ", " + y + ", " + width + ", " + height);
|
||||
|
||||
var godHalfWidth = (this.god.width - Game.GOD_OUT_OF_FACE_WIDTH) / 2;
|
||||
@@ -265,8 +265,8 @@ var Game = {
|
||||
|
||||
var meatClassName = meat.getClassName();
|
||||
|
||||
if(meat.getMeatGrade() == Meat.DONENESS_WELLDONE) {
|
||||
// this.god.animateHappy(Meat.DONENESS_WELLDONE, meatClassName, meat.getTotalCookingTime());
|
||||
if(meat.getMeatGrade() == MeatBase.DONENESS_WELLDONE) {
|
||||
// this.god.animateHappy(MeatBase.DONENESS_WELLDONE, meatClassName, meat.getTotalCookingTime());
|
||||
this.god.animateHappy(meat);
|
||||
|
||||
// var score = this.getScore();
|
||||
@@ -275,8 +275,8 @@ var Game = {
|
||||
|
||||
var tempPlusScore = new PlusScore(this.god.x, this.god.y - 250, score);
|
||||
this.plusScoreGroup.add(tempPlusScore);
|
||||
} else if(meat.getMeatGrade() == Meat.DONENESS_RARE) {
|
||||
// this.god.animateAngryWithRare(Meat.DONENESS_RARE, meatClassName, meat.getTotalCookingTime());
|
||||
} else if(meat.getMeatGrade() == MeatBase.DONENESS_RARE) {
|
||||
// this.god.animateAngryWithRare(MeatBase.DONENESS_RARE, meatClassName, meat.getTotalCookingTime());
|
||||
this.god.animateAngryWithRare(meat);
|
||||
|
||||
// var score = this.getScore();
|
||||
@@ -290,15 +290,17 @@ var Game = {
|
||||
} else {
|
||||
this.badMeatCount++;
|
||||
|
||||
// this.god.animateAngryWithBurnBlack(Meat.DONENESS_BURN_BLACK, meatClassName, meat.getTotalCookingTime());
|
||||
// this.god.animateAngryWithBurnBlack(MeatBase.DONENESS_BURN_BLACK, meatClassName, meat.getTotalCookingTime());
|
||||
this.god.animateAngryWithBurnBlack(meat);
|
||||
/*
|
||||
if(meat.getMeatGrade() == Meat.DONENESS_RARE) {
|
||||
this.god.animateAngry(Meat.DONENESS_RARE); // "날고기 싫어!!!");
|
||||
} else { // Meat.DONENESS_BURN_BLACK
|
||||
this.god.animateAngry(Meat.DONENESS_BURN_BLACK); // "탄 고기 안먹어!!!");
|
||||
if(meat.getMeatGrade() == MeatBase.DONENESS_RARE) {
|
||||
this.god.animateAngry(MeatBase.DONENESS_RARE); // "날고기 싫어!!!");
|
||||
} else { // MeatBase.DONENESS_BURN_BLACK
|
||||
this.god.animateAngry(MeatBase.DONENESS_BURN_BLACK); // "탄 고기 안먹어!!!");
|
||||
}
|
||||
*/
|
||||
|
||||
return; // god doesn't eat burned black meat
|
||||
}
|
||||
|
||||
meat.setActive(false, -100, -100, '');
|
||||
@@ -311,6 +313,47 @@ var Game = {
|
||||
}
|
||||
},
|
||||
|
||||
isOverTrashCan: function(x, y) {
|
||||
// console.log("isOverTrashCan : " + x + ", " + y + ", " + width + ", " + height);
|
||||
|
||||
var trashCanHalfWidth = this.trashCan.width / 2;
|
||||
var trashCanHalfHeight = this.trashCan.height;
|
||||
|
||||
if(x < this.trashCan.x - trashCanHalfWidth) {
|
||||
return false;
|
||||
} else if(this.trashCan.x + trashCanHalfWidth < x) {
|
||||
return false;
|
||||
} else if(y < this.trashCan.y - this.trashCan.height) {
|
||||
return false;
|
||||
} else if(this.trashCan.y < y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
throwAway: function(meat) {
|
||||
// console.log("throw meat");
|
||||
if(meat.getMeatGrade() == MeatBase.DONENESS_BURN_BLACK) {
|
||||
this.trashCan.animateAngry();
|
||||
meat.setActive(false, -100, -100, '');
|
||||
|
||||
var score = meat.getScore();
|
||||
this.scoreManager.plusScore(score);
|
||||
|
||||
var tempPlusScore = new PlusScore(this.trashCan.x, this.trashCan.y - 250, score);
|
||||
this.plusScoreGroup.add(tempPlusScore);
|
||||
|
||||
var meatClassName = meat.getClassName();
|
||||
if(meatClassName == NormalMeat.CLASS_NAME) {
|
||||
this.clearedMeatCount++;
|
||||
if(this.clearedMeatCount == this.activatedMeatCount) {
|
||||
this.clearStage();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clearStage: function() {
|
||||
this.stageTimer.addBonusTime(this.getBonusTime());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user