Fix: MeatBase - NormalMeat - BonusMeat
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user