NormalMeat.prototype = MeatBase.prototype; NormalMeat.constructor = NormalMeat; function NormalMeat(mainGame) { this.mainGame = mainGame; MeatBase.call(this); this.setNormalMeatTypeVariables(); } NormalMeat.prototype.setNormalMeatTypeVariables = function() { this.className = NormalMeat.CLASS_NAME; this.cookingTimeForGradeArray[MeatBase.DONENESS_WELLDONE] = NormalMeat.COOKING_TIME_WELLDONE; this.cookingTimeForGradeArray[MeatBase.DONENESS_BURN_BLACK] = NormalMeat.COOKING_TIME_BURN_BLACK; this.scoreArray[MeatBase.DONENESS_RARE] = NormalMeat.SCORE_RARE; this.scoreArray[MeatBase.DONENESS_WELLDONE] = NormalMeat.SCORE_WELLDONE; this.scoreArray[MeatBase.DONENESS_BURN_BLACK] = NormalMeat.SCORE_BURN_BLACK; } NormalMeat.prototype.changeRandomMeat = function() { this.randomizeMeatType(); this.setNormalMeatSprite(); } NormalMeat.prototype.randomizeMeatType = function() { this.meatType = Math.floor(Math.random() * 3) + 1; } NormalMeat.prototype.setNormalMeatSprite = function() { switch(this.meatType) { case 1: this.baseScale = 0.4; break; case 2: this.baseScale = 0.4; break; case 3: 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; this.spriteNameBurnBlack = NormalMeat.SPRITE_NAME_BURN_BLACK + this.meatType; this.loadTexture(this.spriteNameRare); } NormalMeat.CLASS_NAME = "NormalMeat"; NormalMeat.COOKING_TIME_WELLDONE = 300; NormalMeat.COOKING_TIME_BURN_BLACK = 600; NormalMeat.SCORE_RARE = 1; // cooking time * 1 NormalMeat.SCORE_WELLDONE = 2; // cooking time * 2 NormalMeat.SCORE_BURN_BLACK = 10; // 10 NormalMeat.SPRITE_NAME_RARE = "meat"; NormalMeat.SPRITE_NAME_WELLDONE = "meat_welldone"; NormalMeat.SPRITE_NAME_BURN_BLACK = "meat_burn";