Fork me on GitHub
View source

package haxepunk.math

class Random

Various randomness-related utility functions.


Available since:

4.0.0

Static variables

static read only random : Float

A pseudo-random Float produced using HXP's random seed, where 0 <= Float < 1.

static randomSeed : Int

The random seed used by HXP's random functions.

Static functions

View source

static randInt (amount : Int) : Int

Returns a pseudo-random Int.


Parameters:
amount   

The returned Int will always be 0 <= Int < amount.


Returns:

The Int.

View source

static randomizeSeed () : Void

Randomizes the random seed using Math.random() function.