phaser - v4.0.0-rc.4
    Preparing search index...

    Function RandomXY

    • Compute a random unit vector.

      Computes random values for the given vector between -1 and 1 that can be used to represent a direction.

      Optionally accepts a scale value to scale the resulting vector by.

      Parameters

      • vector: Math.Vector2

        The Vector to compute random values for.

      • Optionalscale: number

        The scale of the random values. Default 1.

      Returns Math.Vector2