mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Merge pull request #2328 from taylankasap/dev
Added RandomDataGenerator.sign (returns -1 or +1)
This commit is contained in:
commit
6cf8bc75ba
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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue