Add: meat classes

This commit is contained in:
2019-12-09 11:10:33 +09:00
parent 1dc49cfb94
commit 36298d7621
7 changed files with 439 additions and 13 deletions
@@ -0,0 +1,52 @@
NormalMeat.prototype = MeatBase.prototype;
NormalMeat.constructor = NormalMeat;
function NormalMeat() {
MeatBase.call(this);
this.setMeatTypeVariables();
this.randomizeMeatType();
}
NormalMeat.prototype.setMeatTypeVariables = function() {
this.cookingSpeed = NormalMeat.COOKING_SPEED_BURN_LEVEL_WEAK;
}
NormalMeat.prototype.randomizeMeatType = function() {
this.meatType = Math.floor(Math.random() * 3) + 1;
switch(this.meatType) {
case 1:
this.scale.set(0.5);
break;
case 2:
this.scale.set(0.5);
break;
case 3:
this.scale.set(0.5);
break;
}
this.spriteNameRare = NormalMeat.SPRITE_NAME_RARE + this.meatType;
this.spriteNameWelldone = NormalMeat.SPRITE_NAME_WELLDONE + this.meatType;
this.spriteNameBurnBlack = NormalMeat.SPRITE_NAME_BURN_BLACK + this.meatType;
this.loadTexture(this.spriteNameRare);
}
NormalMeat.COOKING_SPEED_BURN_LEVEL_WEAK = 0.1;
NormalMeat.COOKING_SPEED_BURN_LEVEL_NORMAL = 0.2;
NormalMeat.COOKING_SPEED_BURN_LEVEL_STRONG = 0.3;
NormalMeat.SCORE_NAME_RARE = 10;
NormalMeat.SCORE_NAME_WELLDONE = 100;
NormalMeat.SCORE_NAME_BURN_BLACK = 0;
NormalMeat.SPRITE_NAME_RARE = "meat";
NormalMeat.SPRITE_NAME_WELLDONE = "meat_welldone";
NormalMeat.SPRITE_NAME_BURN_BLACK = "meat_burn";