diff --git a/README.md b/README.md index 928d22c12..3cf3d7051 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,7 @@ can be controlled per-input mode. * Keyboard.addCallbacks didn't check to see if the arguments were `null`, only if they were `undefined` making the jsdocs misleading. * ScaleManager.getParentBounds now takes any transforms into account to get the correct parent bounds (thanks @jdnichollsc #2111 #2098) * Cache.addBitmapFont now applies a default value for the x and y spacing if the arguments are omitted (thanks @nlotz #2128) +* Removed use of the `tilePosition` property in the Phaser.Rope class as it isn't implemented and caused calls to `Rope.reset` to crash (thanks @spayton #2135) ### Pixi Updates diff --git a/src/gameobjects/Rope.js b/src/gameobjects/Rope.js index bb7622139..7588a5e63 100644 --- a/src/gameobjects/Rope.js +++ b/src/gameobjects/Rope.js @@ -5,9 +5,11 @@ */ /** -* A Rope is a Sprite that has a repeating texture. The texture can be scrolled and scaled and will automatically wrap on the edges as it does so. -* Please note that Ropes, as with normal Sprites, have no input handler or physics bodies by default. Both need enabling. -* Example usage: https://github.com/codevinsky/phaser-rope-demo/blob/master/dist/demo.js +* A Rope is a Sprite that has a repeating texture. +* +* The texture will automatically wrap on the edges as it moves. +* +* Please note that Ropes cannot have an input handler. * * @class Phaser.Rope * @constructor @@ -22,7 +24,6 @@ * @extends Phaser.Component.Delta * @extends Phaser.Component.Destroy * @extends Phaser.Component.FixedToCamera -* @extends Phaser.Component.InputEnabled * @extends Phaser.Component.InWorld * @extends Phaser.Component.LifeSpan * @extends Phaser.Component.LoadTexture @@ -55,12 +56,6 @@ Phaser.Rope = function (game, x, y, key, frame, points) { */ this.type = Phaser.ROPE; - /** - * @property {Phaser.Point} _scroll - Internal cache var. - * @private - */ - this._scroll = new Phaser.Point(); - PIXI.Rope.call(this, PIXI.TextureCache['__default'], this.points); Phaser.Component.Core.init.call(this, game, x, y, key, frame); @@ -80,7 +75,6 @@ Phaser.Component.Core.install.call(Phaser.Rope.prototype, [ 'Delta', 'Destroy', 'FixedToCamera', - 'InputEnabled', 'InWorld', 'LifeSpan', 'LoadTexture', @@ -104,16 +98,6 @@ Phaser.Rope.prototype.preUpdateCore = Phaser.Component.Core.preUpdate; */ Phaser.Rope.prototype.preUpdate = function() { - if (this._scroll.x !== 0) - { - this.tilePosition.x += this._scroll.x * this.game.time.physicsElapsed; - } - - if (this._scroll.y !== 0) - { - this.tilePosition.y += this._scroll.y * this.game.time.physicsElapsed; - } - if (!this.preUpdatePhysics() || !this.preUpdateLifeSpan() || !this.preUpdateInWorld()) { return false; @@ -139,7 +123,7 @@ Phaser.Rope.prototype.update = function() { }; /** -* Resets the Rope. This places the Rope at the given x/y world coordinates, resets the tilePosition and then +* Resets the Rope. This places the Rope at the given x/y world coordinates and then * sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state. * If the Rope has a physics body that too is reset. * @@ -153,15 +137,12 @@ Phaser.Rope.prototype.reset = function(x, y) { Phaser.Component.Reset.prototype.reset.call(this, x, y); - this.tilePosition.x = 0; - this.tilePosition.y = 0; - return this; }; /** -* A Rope will call it's updateAnimation function on each update loop if it has one +* A Rope will call its updateAnimation function on each update loop if it has one. * * @name Phaser.Rope#updateAnimation * @property {function} updateAnimation - Set to a function if you'd like the rope to animate during the update phase. Set to false or null to remove it.