From f0d7da1c56e5a8ef385608646bec97caf2ca432c Mon Sep 17 00:00:00 2001 From: photonstorm Date: Thu, 27 Aug 2015 19:28:01 +0100 Subject: [PATCH] Removed RND.float as it's a reserved word :( Fixed jshint errors. --- README.md | 1 - src/math/RandomDataGenerator.js | 15 --------------- src/particles/arcade/Emitter.js | 6 +++--- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 47b8f403a..b125dcb7e 100644 --- a/README.md +++ b/README.md @@ -266,7 +266,6 @@ If you are an exceptional JavaScript developer and would like to join the Phaser * JSDoc typo fixes (thanks @rwrountree) * Math.average has been optimized (thanks @rwrountree #2025) * Change splice.call(arguments, ..) to use slice instead (thanks @pnstickne #2034 #2032) -* RandomDataGenerator.float is a new alias for the method 'realInRange' and takes the same arguments. ### Bug Fixes diff --git a/src/math/RandomDataGenerator.js b/src/math/RandomDataGenerator.js index 0f83d283a..54997e0e0 100644 --- a/src/math/RandomDataGenerator.js +++ b/src/math/RandomDataGenerator.js @@ -203,21 +203,6 @@ Phaser.RandomDataGenerator.prototype = { }, - /** - * Returns a random real number between min and max. - * This method is an alias for RandomDataGenerator.realInRange. - * - * @method Phaser.RandomDataGenerator#float - * @param {number} min - The minimum value in the range. - * @param {number} max - The maximum value in the range. - * @return {number} A random number between min and max. - */ - float: function (min, max) { - - return this.realInRange(min, max); - - }, - /** * Returns a random real number between min and max. * diff --git a/src/particles/arcade/Emitter.js b/src/particles/arcade/Emitter.js index 689b6612d..07ac7c1bf 100644 --- a/src/particles/arcade/Emitter.js +++ b/src/particles/arcade/Emitter.js @@ -613,11 +613,11 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr } else if (this.minParticleScale !== 1 || this.maxParticleScale !== 1) { - particle.scale.set(rnd.float(this.minParticleScale, this.maxParticleScale)); + particle.scale.set(rnd.realInRange(this.minParticleScale, this.maxParticleScale)); } else if ((this._minParticleScale.x !== this._maxParticleScale.x) || (this._minParticleScale.y !== this._maxParticleScale.y)) { - particle.scale.set(rnd.float(this._minParticleScale.x, this._maxParticleScale.x), rnd.float(this._minParticleScale.y, this._maxParticleScale.y)); + particle.scale.set(rnd.realInRange(this._minParticleScale.x, this._maxParticleScale.x), rnd.realInRange(this._minParticleScale.y, this._maxParticleScale.y)); } if (frame === undefined) @@ -638,7 +638,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr } else { - particle.alpha = rnd.float(this.minParticleAlpha, this.maxParticleAlpha); + particle.alpha = rnd.realInRange(this.minParticleAlpha, this.maxParticleAlpha); } particle.blendMode = this.blendMode;