Merge pull request #2328 from taylankasap/dev

Added RandomDataGenerator.sign (returns -1 or +1)
This commit is contained in:
Richard Davey 2016-02-18 15:03:51 +02:00
commit 6cf8bc75ba

View file

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