Fix: MeatBase - NormalMeat - BonusMeat

This commit is contained in:
2019-12-10 07:49:23 +09:00
parent 36298d7621
commit f77057ed8e
4 changed files with 51 additions and 44 deletions
+10 -4
View File
@@ -1,11 +1,14 @@
NormalMeat.prototype = MeatBase.prototype;
NormalMeat.constructor = NormalMeat;
function NormalMeat() {
function NormalMeat(mainGame) {
this.mainGame = mainGame;
MeatBase.call(this);
this.setMeatTypeVariables();
this.randomizeMeatType();
this.setSprite();
}
@@ -15,20 +18,23 @@ NormalMeat.prototype.setMeatTypeVariables = function() {
NormalMeat.prototype.randomizeMeatType = function() {
this.meatType = Math.floor(Math.random() * 3) + 1;
}
NormalMeat.prototype.setSprite = function() {
switch(this.meatType) {
case 1:
this.scale.set(0.5);
this.baseScale = 0.4;
break;
case 2:
this.scale.set(0.5);
this.baseScale = 0.4;
break;
case 3:
this.scale.set(0.5);
this.baseScale = 0.5;
break;
}
this.scale.set(this.baseScale);
this.spriteNameRare = NormalMeat.SPRITE_NAME_RARE + this.meatType;
this.spriteNameWelldone = NormalMeat.SPRITE_NAME_WELLDONE + this.meatType;