Phaser.Events = function (sprite){ this.parent = sprite; } ; Phaser.Events.prototype = { destroy: function (){ this._parent = null ; if (this._onDestroy) { this._onDestroy.dispose(); } if (this._onAddedToGroup) { this._onAddedToGroup.dispose(); } if (this._onRemovedFromGroup) { this._onRemovedFromGroup.dispose(); } if (this._onRemovedFromWorld) { this._onRemovedFromWorld.dispose(); } if (this._onKilled) { this._onKilled.dispose(); } if (this._onRevived) { this._onRevived.dispose(); } if (this._onEnterBounds) { this._onEnterBounds.dispose(); } if (this._onOutOfBounds) { this._onOutOfBounds.dispose(); } if (this._onInputOver) { this._onInputOver.dispose(); } if (this._onInputOut) { this._onInputOut.dispose(); } if (this._onInputDown) { this._onInputDown.dispose(); } if (this._onInputUp) { this._onInputUp.dispose(); } if (this._onDragStart) { this._onDragStart.dispose(); } if (this._onDragStop) { this._onDragStop.dispose(); } if (this._onAnimationStart) { this._onAnimationStart.dispose(); } if (this._onAnimationComplete) { this._onAnimationComplete.dispose(); } if (this._onAnimationLoop) { this._onAnimationLoop.dispose(); } } , onAddedToGroup: null , onRemovedFromGroup: null , onRemovedFromWorld: null , onDestroy: null , onKilled: null , onRevived: null , onOutOfBounds: null , onEnterBounds: null , onInputOver: null , onInputOut: null , onInputDown: null , onInputUp: null , onDragStart: null , onDragStop: null , onAnimationStart: null , onAnimationComplete: null , onAnimationLoop: null } ; Phaser.Events.prototype.constructor = Phaser.Events; for (var prop in Phaser.Events.prototype){ if (!Phaser.Events.prototype.hasOwnProperty(prop) || prop.indexOf('on') !== 0 || Phaser.Events.prototype[prop] !== null ) { continue ; } (function (prop, backing){ 'use strict'; Object.defineProperty(Phaser.Events.prototype, prop, { get: function (){ return this[backing] || (this[backing] = new Phaser.Signal()); } } ); Phaser.Events.prototype[prop + '$dispatch'] = function (){ return this[backing]? this[backing].dispatch.apply(this[backing], arguments): null ; } ; } )(prop, '_' + prop); }