Phaser.Plugin.SamplePlugin = function (game, parent){ Phaser.Plugin.call(this, game, parent); this.sprite = null ; } ; Phaser.Plugin.SamplePlugin.prototype = Object.create(Phaser.Plugin.prototype); Phaser.Plugin.SamplePlugin.prototype.constructor = Phaser.Plugin.SamplePlugin; Phaser.Plugin.SamplePlugin.prototype.addSprite = function (sprite){ this.sprite = sprite; } ; Phaser.Plugin.SamplePlugin.prototype.update = function (){ if (this.sprite) { this.sprite.x += 0.5; } } ;