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)

This commit is contained in:
photonstorm 2015-10-13 12:20:02 +01:00
parent 8e4dc1f078
commit 84373dc478
2 changed files with 8 additions and 26 deletions

View file

@ -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

View file

@ -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.