File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ var Curve = new Class({
9393 getLengths : require ( './inc/GetLengths' ) ,
9494 getPointAt : require ( './inc/GetPointAt' ) ,
9595 getPoints : require ( './inc/GetPoints' ) ,
96+ getRandomPoint : require ( './inc/GetRandomPoint' ) ,
9697 getSpacedPoints : require ( './inc/GetSpacedPoints' ) ,
9798 getStartPoint : require ( './inc/GetStartPoint' ) ,
9899 getTangent : require ( './inc/GetTangent' ) ,
Original file line number Diff line number Diff line change 1+ var Vector2 = require ( '../../../math/Vector2' ) ;
2+
3+ /**
4+ * [description]
5+ *
6+ * @method Phaser.Curves.Curve#getRandomPoint
7+ * @since 3.0.0
8+ *
9+ * @param {Phaser.Math.Vector2 } [out] - [description]
10+ *
11+ * @return {Phaser.Math.Vector2 } [description]
12+ */
13+ var GetRandomPoint = function ( out )
14+ {
15+ if ( out === undefined ) { out = new Vector2 ( ) ; }
16+
17+ return this . getPoint ( Math . random ( ) , out ) ;
18+ } ;
19+
20+ module . exports = GetRandomPoint ;
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ var Path = new Class({
5151 getLength : require ( './inc/GetLength' ) ,
5252 getPoint : require ( './inc/GetPoint' ) ,
5353 getPoints : require ( './inc/GetPoints' ) ,
54+ getRandomPoint : require ( './inc/GetRandomPoint' ) ,
5455 getSpacedPoints : require ( './inc/GetSpacedPoints' ) ,
5556 getStartPoint : require ( './inc/GetStartPoint' ) ,
5657 lineTo : require ( './inc/LineTo' ) ,
Original file line number Diff line number Diff line change 1+ var Vector2 = require ( '../../../math/Vector2' ) ;
2+
3+ /**
4+ * [description]
5+ *
6+ * @method Phaser.Curves.Path#getRandomPoint
7+ * @since 3.0.0
8+ *
9+ * @param {Phaser.Math.Vector2 } [out] - [description]
10+ *
11+ * @return {Phaser.Math.Vector2 } [description]
12+ */
13+ var GetRandomPoint = function ( out )
14+ {
15+ if ( out === undefined ) { out = new Vector2 ( ) ; }
16+
17+ return this . getPoint ( Math . random ( ) , out ) ;
18+ } ;
19+
20+ module . exports = GetRandomPoint ;
You can’t perform that action at this time.
0 commit comments