We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3128f9 commit 92e4345Copy full SHA for 92e4345
1 file changed
src/math/angle/Random.js
@@ -1,8 +1,15 @@
1
+/**
2
+ * @author Richard Davey <rich@photonstorm.com>
3
+ * @author @samme
4
+ * @copyright 2020 Photon Storm Ltd.
5
+ * @license {@link https://opensource.org/licenses/MIT|MIT License}
6
+ */
7
+
8
var FloatBetween = require('../FloatBetween');
9
var CONST = require('../const');
10
11
/**
- * Returns a random angle in the range [0, 2pi].
12
+ * Returns a random angle in the range [-pi, pi].
13
*
14
* @function Phaser.Math.Angle.Random
15
* @since 3.23.0
@@ -11,7 +18,7 @@ var CONST = require('../const');
18
*/
19
var Random = function ()
20
{
- return FloatBetween(0, CONST.PI2);
21
+ return FloatBetween(-Math.PI, Math.PI);
22
};
16
23
17
24
module.exports = Random;
0 commit comments