var EHDI = EHDI || Object.create(null); EHDI.components = EHDI.components || Object.create(null); EHDI.components.Note = function(index, time) { EHDI.aka.Container.call(this); this.trail = new EHDI.aka.Sprite(EHDI.Assets.images["kinnor_butrail"]); this.trail.anchor.set(0.5, 1); this.addChild(this.trail); this.sprite = new EHDI.aka.Sprite(EHDI.Assets.images["kinnor_butdefault"]); this.sprite.anchor.set(0.5, 0.5); this.position.x = EHDI.GAME.sceneManager.getStageWidth() * (0.356 + 0.09 * index); this.spawnTime = time; this.state = "default"; this.addChild(this.sprite); }; EHDI.components.Note.prototype = Object.create(EHDI.aka.Container.prototype); EHDI.components.Note.prototype.hit = function() { this.sprite.texture = EHDI.Assets.images["kinnor_buthit"]; this.state = "hit"; }; EHDI.components.Note.prototype.miss = function() { this.sprite.texture = EHDI.Assets.images["kinnor_butmiss"]; this.trail.visible = false; this.state = "miss"; };