Phaser API Documentation

  Version: 

Member of: Phaser.Curves.Path

getRandomPoint([out])

Description:

Returns a randomly chosen point anywhere on the path. This follows the same rules as getPoint in that it may return a point on any Curve inside this path.

When calling this method multiple times, the points are not guaranteed to be equally spaced spatially.

Parameters:

name type arguments description
out Phaser.Math.Vector2 <optional>

Vector2 instance that should be used for storing the result. If undefined a new Vector2 will be created.

Returns:
Description:

The modified out object, or a new Vector2 if none was provided.

Since: 3.0.0
Source: src/curves/path/Path.js (Line 625)