mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Added RandomDataGenerator.sign (returns -1 or +1)
This commit is contained in:
parent
1465d18d6b
commit
1310daa9af
1 changed files with 12 additions and 0 deletions
|
@ -268,6 +268,18 @@ Phaser.RandomDataGenerator.prototype = {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a sign to be used with multiplication operator.
|
||||||
|
*
|
||||||
|
* @method Phaser.RandomDataGenerator#sign
|
||||||
|
* @return {number} -1 or +1.
|
||||||
|
*/
|
||||||
|
sign: function () {
|
||||||
|
|
||||||
|
return this.pick([-1, 1]);
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random member of `array`, favoring the earlier entries.
|
* Returns a random member of `array`, favoring the earlier entries.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue