Skip to content

Commit ddcc461

Browse files
committed
RandomDataGenerator.float is a new alias for the method 'realInRange' and takes the same arguments.
1 parent 9798864 commit ddcc461

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
266266
* JSDoc typo fixes (thanks @rwrountree)
267267
* Math.average has been optimized (thanks @rwrountree #2025)
268268
* Change splice.call(arguments, ..) to use slice instead (thanks @pnstickne #2034 #2032)
269+
* RandomDataGenerator.float is a new alias for the method 'realInRange' and takes the same arguments.
269270

270271
### Bug Fixes
271272

src/math/RandomDataGenerator.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ Phaser.RandomDataGenerator.prototype = {
203203

204204
},
205205

206+
/**
207+
* Returns a random real number between min and max.
208+
* This method is an alias for RandomDataGenerator.realInRange.
209+
*
210+
* @method Phaser.RandomDataGenerator#float
211+
* @param {number} min - The minimum value in the range.
212+
* @param {number} max - The maximum value in the range.
213+
* @return {number} A random number between min and max.
214+
*/
215+
float: function (min, max) {
216+
217+
return this.realInRange(min, max);
218+
219+
},
220+
206221
/**
207222
* Returns a random real number between min and max.
208223
*

0 commit comments

Comments
 (0)