var EHDI = EHDI || Object.create(null); EHDI.components = EHDI.components || Object.create(null); EHDI.components.Sheep = function(color) { EHDI.aka.Container.call(this); this.armature = EHDI.GAME.dbFactory.buildArmature("lambs_2"); dragonBones.WorldClock.clock.add(this.armature); this.armature.animation.gotoAndPlay("lamb_" + color + "_an_baa", -1, -1, 0); this.sheep = this.armature.getDisplay(); this.addChild(this.sheep); var anchor = {x : 0.5, y : 1}; this.sprite = {anchor : anchor}; this.collider = EHDI.displays.FillRectangle(0x0000AA, 0, 0, 75, 50, 0); this.collider.x = 13.6; this.collider.y = 12.8; this.collider.anchor.x = 0.5; this.collider.anchor.y = 1; this.collider.visible = false; this.addChild(this.collider); this.isSheep = true; }; EHDI.components.Sheep.prototype = Object.create(EHDI.aka.Container.prototype); EHDI.components.Sheep.prototype.checkIfPlaySFX = function() { if(this.x > 0 && this.x< EHDI.GAME.sceneManager.getStageWidth() && !this.haveIPlaySFX) { this.haveIPlaySFX = true; EHDI.GAME.soundManager.playSFX("sheep"); } };