Add: bonus meat into game
This commit is contained in:
@@ -12,7 +12,17 @@ function BonusMeat(mainGame) {
|
|||||||
|
|
||||||
|
|
||||||
BonusMeat.prototype.setBonusMeatTypeVariables = function() {
|
BonusMeat.prototype.setBonusMeatTypeVariables = function() {
|
||||||
this.cookingSpeed = BonusMeat.COOKING_SPEED_BURN_LEVEL_WEAK;
|
this.className = BonusMeat.CLASS_NAME;
|
||||||
|
|
||||||
|
this.cookingSpeedArray = [];
|
||||||
|
this.cookingSpeedArray[HeatPlate.BURN_LEVEL_WEAK] = BonusMeat.COOKING_SPEED_BURN_LEVEL_WEAK;
|
||||||
|
this.cookingSpeedArray[HeatPlate.BURN_LEVEL_NORMAL] = BonusMeat.COOKING_SPEED_BURN_LEVEL_NORMAL;
|
||||||
|
this.cookingSpeedArray[HeatPlate.BURN_LEVEL_STRONG] = BonusMeat.COOKING_SPEED_BURN_LEVEL_STRONG;
|
||||||
|
|
||||||
|
this.scoreArray = [];
|
||||||
|
this.scoreArray[MeatBase.DONENESS_RARE] = BonusMeat.SCORE_NAME_RARE;
|
||||||
|
this.scoreArray[MeatBase.DONENESS_WELLDONE] = BonusMeat.SCORE_NAME_WELLDONE;
|
||||||
|
this.scoreArray[MeatBase.DONENESS_BURN_BLACK] = BonusMeat.SCORE_NAME_BURN_BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
BonusMeat.prototype.setBonusMeatSprite = function() {
|
BonusMeat.prototype.setBonusMeatSprite = function() {
|
||||||
@@ -26,12 +36,14 @@ BonusMeat.prototype.setBonusMeatSprite = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BonusMeat.CLASS_NAME = "BonusMeat";
|
||||||
|
|
||||||
BonusMeat.COOKING_SPEED_BURN_LEVEL_WEAK = 0.1;
|
BonusMeat.COOKING_SPEED_BURN_LEVEL_WEAK = 0.1;
|
||||||
BonusMeat.COOKING_SPEED_BURN_LEVEL_NORMAL = 0.2;
|
BonusMeat.COOKING_SPEED_BURN_LEVEL_NORMAL = 0.2;
|
||||||
BonusMeat.COOKING_SPEED_BURN_LEVEL_STRONG = 0.3;
|
BonusMeat.COOKING_SPEED_BURN_LEVEL_STRONG = 0.3;
|
||||||
|
|
||||||
BonusMeat.SCORE_NAME_RARE = 10;
|
BonusMeat.SCORE_NAME_RARE = 1;
|
||||||
BonusMeat.SCORE_NAME_WELLDONE = 100;
|
BonusMeat.SCORE_NAME_WELLDONE = 5;
|
||||||
BonusMeat.SCORE_NAME_BURN_BLACK = 0;
|
BonusMeat.SCORE_NAME_BURN_BLACK = 0;
|
||||||
|
|
||||||
BonusMeat.SPRITE_NAME_RARE = "bonus_meat";
|
BonusMeat.SPRITE_NAME_RARE = "bonus_meat";
|
||||||
|
|||||||
@@ -271,7 +271,17 @@ 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 = this.getScore();
|
// var score = this.getScore();
|
||||||
|
var score = meat.getScore(Meat.DONENESS_WELLDONE);
|
||||||
|
this.scoreManager.plusScore(score);
|
||||||
|
|
||||||
|
var tempPlusScore = new PlusScore(this.god.x, this.god.y - 180, score);
|
||||||
|
this.plusScoreGroup.add(tempPlusScore);
|
||||||
|
} else if(meat.getMeatGrade() == Meat.DONENESS_RARE) {
|
||||||
|
this.god.animateAngry(Meat.DONENESS_RARE); // "날고기 싫어!!!");
|
||||||
|
|
||||||
|
// var score = this.getScore();
|
||||||
|
var score = meat.getScore(Meat.DONENESS_WELLDONE);
|
||||||
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);
|
||||||
@@ -279,18 +289,24 @@ var Game = {
|
|||||||
} else {
|
} else {
|
||||||
this.badMeatCount++;
|
this.badMeatCount++;
|
||||||
|
|
||||||
|
this.god.animateAngry(Meat.DONENESS_BURN_BLACK); // "탄 고기 안먹어!!!");
|
||||||
|
/*
|
||||||
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
|
||||||
this.god.animateAngry(Meat.DONENESS_BURN_BLACK); // "탄 고기 안먹어!!!");
|
this.god.animateAngry(Meat.DONENESS_BURN_BLACK); // "탄 고기 안먹어!!!");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
meat.setActive(false, -100, -100, '');
|
meat.setActive(false, -100, -100, '');
|
||||||
|
|
||||||
|
if(meat.getClassName() == NormalMeat.CLASS_NAME) {
|
||||||
this.clearedMeatCount++;
|
this.clearedMeatCount++;
|
||||||
if(this.clearedMeatCount == this.activatedMeatCount) {
|
if(this.clearedMeatCount == this.activatedMeatCount) {
|
||||||
this.clearStage();
|
this.clearStage();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
clearStage: function() {
|
clearStage: function() {
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ MeatBase.prototype.initMeatTypeVariables = function() {
|
|||||||
|
|
||||||
this.baseScale = 0.5;
|
this.baseScale = 0.5;
|
||||||
|
|
||||||
this.rareScore = 0;
|
this.className = "MeatBase";
|
||||||
this.welldoneScore = 0;
|
|
||||||
this.burnBlackScore = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -144,6 +142,18 @@ MeatBase.prototype.onDragStopListener = function(pointer) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MeatBase.prototype.getClassName = function() {
|
||||||
|
return this.className;
|
||||||
|
}
|
||||||
|
|
||||||
|
MeatBase.prototype.getScore = function(meatDoneness) {
|
||||||
|
var scoreDoneness = this.scoreArray[meatDoneness];
|
||||||
|
var totalCookingTime = this.cookingTime[MeatBase.MEAT_BACK] + this.cookingTime[MeatBase.MEAT_FRONT];
|
||||||
|
|
||||||
|
console.log(totalCookingTime);
|
||||||
|
return scoreDoneness * totalCookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
MeatBase.prototype.isFront = function() {
|
MeatBase.prototype.isFront = function() {
|
||||||
if(this.cookingSide == MeatBase.MEAT_BACK)
|
if(this.cookingSide == MeatBase.MEAT_BACK)
|
||||||
return true;
|
return true;
|
||||||
@@ -313,18 +323,20 @@ MeatBase.prototype.changeAnimateSmokeColor = function(type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MeatBase.CLASS_NAME = "MeatBase";
|
||||||
|
|
||||||
MeatBase.MEAT_NONE = 0;
|
MeatBase.MEAT_NONE = 0;
|
||||||
MeatBase.MEAT_FRONT = 1;
|
MeatBase.MEAT_FRONT = 1;
|
||||||
MeatBase.MEAT_BACK = 2;
|
MeatBase.MEAT_BACK = 2;
|
||||||
|
|
||||||
|
MeatBase.ANGLE_NONE = 0;
|
||||||
|
MeatBase.ANGLE_FRONT = 30;
|
||||||
|
MeatBase.ANGLE_BACK = -30;
|
||||||
|
|
||||||
MeatBase.DONENESS_RARE = 0;
|
MeatBase.DONENESS_RARE = 0;
|
||||||
MeatBase.DONENESS_WELLDONE = 1;
|
MeatBase.DONENESS_WELLDONE = 1;
|
||||||
MeatBase.DONENESS_BURN_BLACK = 2;
|
MeatBase.DONENESS_BURN_BLACK = 2;
|
||||||
MeatBase.DONENESS_NONE = 3;
|
MeatBase.DONENESS_NONE = 3;
|
||||||
|
|
||||||
MeatBase.ANGLE_NONE = 0;
|
|
||||||
MeatBase.ANGLE_FRONT = 30;
|
|
||||||
MeatBase.ANGLE_BACK = -30;
|
|
||||||
|
|
||||||
MeatBase.COOK_TIME_WELLDONE = 20;
|
MeatBase.COOK_TIME_WELLDONE = 20;
|
||||||
MeatBase.COOK_TIME_BURN = 400;
|
MeatBase.COOK_TIME_BURN = 400;
|
||||||
@@ -13,7 +13,17 @@ function NormalMeat(mainGame) {
|
|||||||
|
|
||||||
|
|
||||||
NormalMeat.prototype.setNormalMeatTypeVariables = function() {
|
NormalMeat.prototype.setNormalMeatTypeVariables = function() {
|
||||||
this.cookingSpeed = NormalMeat.COOKING_SPEED_BURN_LEVEL_WEAK;
|
this.className = NormalMeat.CLASS_NAME;
|
||||||
|
|
||||||
|
this.cookingSpeedArray = [];
|
||||||
|
this.cookingSpeedArray[HeatPlate.BURN_LEVEL_WEAK] = NormalMeat.COOKING_SPEED_BURN_LEVEL_WEAK;
|
||||||
|
this.cookingSpeedArray[HeatPlate.BURN_LEVEL_NORMAL] = NormalMeat.COOKING_SPEED_BURN_LEVEL_NORMAL;
|
||||||
|
this.cookingSpeedArray[HeatPlate.BURN_LEVEL_STRONG] = NormalMeat.COOKING_SPEED_BURN_LEVEL_STRONG;
|
||||||
|
|
||||||
|
this.scoreArray = [];
|
||||||
|
this.scoreArray[MeatBase.DONENESS_RARE] = NormalMeat.SCORE_NAME_RARE;
|
||||||
|
this.scoreArray[MeatBase.DONENESS_WELLDONE] = NormalMeat.SCORE_NAME_WELLDONE;
|
||||||
|
this.scoreArray[MeatBase.DONENESS_BURN_BLACK] = NormalMeat.SCORE_NAME_BURN_BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NormalMeat.prototype.randomizeMeatType = function() {
|
NormalMeat.prototype.randomizeMeatType = function() {
|
||||||
@@ -45,12 +55,14 @@ NormalMeat.prototype.setNormalMeatSprite = function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NormalMeat.CLASS_NAME = "NormalMeat";
|
||||||
|
|
||||||
NormalMeat.COOKING_SPEED_BURN_LEVEL_WEAK = 0.1;
|
NormalMeat.COOKING_SPEED_BURN_LEVEL_WEAK = 0.1;
|
||||||
NormalMeat.COOKING_SPEED_BURN_LEVEL_NORMAL = 0.2;
|
NormalMeat.COOKING_SPEED_BURN_LEVEL_NORMAL = 0.2;
|
||||||
NormalMeat.COOKING_SPEED_BURN_LEVEL_STRONG = 0.3;
|
NormalMeat.COOKING_SPEED_BURN_LEVEL_STRONG = 0.3;
|
||||||
|
|
||||||
NormalMeat.SCORE_NAME_RARE = 10;
|
NormalMeat.SCORE_NAME_RARE = 1;
|
||||||
NormalMeat.SCORE_NAME_WELLDONE = 100;
|
NormalMeat.SCORE_NAME_WELLDONE = 2;
|
||||||
NormalMeat.SCORE_NAME_BURN_BLACK = 0;
|
NormalMeat.SCORE_NAME_BURN_BLACK = 0;
|
||||||
|
|
||||||
NormalMeat.SPRITE_NAME_RARE = "meat";
|
NormalMeat.SPRITE_NAME_RARE = "meat";
|
||||||
|
|||||||
@@ -65,17 +65,19 @@
|
|||||||
<script src="../../game/mouse/grilled_meat/loading.js"></script>
|
<script src="../../game/mouse/grilled_meat/loading.js"></script>
|
||||||
|
|
||||||
<script src="../../game/mouse/grilled_meat/god.js"></script>
|
<script src="../../game/mouse/grilled_meat/god.js"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/smoke.js"></script>
|
|
||||||
<script src="../../game/mouse/grilled_meat/meat.js"></script>
|
|
||||||
<script src="../../game/mouse/grilled_meat/meat_base.js"></script>
|
|
||||||
<script src="../../game/mouse/grilled_meat/normal_meat.js"></script>
|
|
||||||
<script src="../../game/mouse/grilled_meat/bonus_meat.js"></script>
|
|
||||||
<script src="../../game/mouse/grilled_meat/plus_score.js"></script>
|
<script src="../../game/mouse/grilled_meat/plus_score.js"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/speech_bubble.js"></script>
|
<script src="../../game/mouse/grilled_meat/speech_bubble.js"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/heat_plate.js"></script>
|
<script src="../../game/mouse/grilled_meat/heat_plate.js"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/stove_dial.js"></script>
|
<script src="../../game/mouse/grilled_meat/stove_dial.js"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/trash_can.js"></script>
|
<script src="../../game/mouse/grilled_meat/trash_can.js"></script>
|
||||||
|
|
||||||
|
<script src="../../game/mouse/grilled_meat/smoke.js"></script>
|
||||||
|
<script src="../../game/mouse/grilled_meat/meat.js"></script>
|
||||||
|
<script src="../../game/mouse/grilled_meat/meat_base.js"></script>
|
||||||
|
<script src="../../game/mouse/grilled_meat/normal_meat.js"></script>
|
||||||
|
<script src="../../game/mouse/grilled_meat/bonus_meat.js"></script>
|
||||||
|
|
||||||
<script src="../../game/mouse/grilled_meat/game.js?update=190916"></script>
|
<script src="../../game/mouse/grilled_meat/game.js?update=190916"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/main.js"></script>
|
<script src="../../game/mouse/grilled_meat/main.js"></script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user