Table of Contents

Component Gameplay

(NOTE) A random object that contains its own unique random state apart from all other instances of this class.

Methods Properties Base Classes Derived Classes
BellCurve MaxInt component
BellCurveDistribution RandomSeed
BellCurveRange Seed
Bool
CoinFlip
DieRoll
DoubleRange
DoubleReal
DoubleRealVariance
Float
FloatVariance
Int
IntVariance
Probability
Quaternion
Constructor
Range
RangeExclusiveMax
RangeInclusiveMax
Real
Real2
Real3
RealVariance
Rotation
UnitReal2
UnitReal3
UnitVector2
UnitVector3
Vector2
Vector3

Properties


MaxInt : integer

read-only

The max integer value that can be returned.

var MaxInt : Integer

RandomSeed : boolean

var RandomSeed : Boolean

Seed : integer

Seeds the random number generator.

var Seed : Integer

Methods


BellCurve : real

Samples a bell curve with standard normal distribution in the range [0,1] This is equivalent to a Gaussian distribution with standard deviation of 1. |Name|Type|Description| |---|---|---|

function BellCurve() : Real

BellCurveDistribution : real

Samples a bell curve in the range [center - range, center + range] with the given standard deviation. Around 68% will lie within the 1st standard deviation. |Name|Type|Description| |---|---|---| |center|real| | |range|real| | |standardDeviation|real| |

function BellCurveDistribution(center : Real, range : Real, standardDeviation : Real) : Real

BellCurveRange : real

Samples a bell curve with in the range [center - range, center + range] This uses a standard deviation of 1. |Name|Type|Description| |---|---|---| |center|real| | |range|real| |

function BellCurveRange(center : Real, range : Real) : Real

Bool : boolean

Returns a random bool value. |Name|Type|Description| |---|---|---|

function Bool() : Boolean

CoinFlip : boolean

Returns true if the coin flips heads. |Name|Type|Description| |---|---|---|

function CoinFlip() : Boolean

DieRoll : integer

Randomly rolls a number in the range [1, sides]. |Name|Type|Description| |---|---|---| |sides|integer| |

function DieRoll(sides : Integer) : Integer

DoubleRange : doublereal

Name Type Description
doublereal
doublereal
function DoubleRange( : DoubleReal,  : DoubleReal) : DoubleReal

DoubleReal : doublereal

Returns a random double real in the range [0,1]. |Name|Type|Description| |---|---|---|

function DoubleReal() : DoubleReal

DoubleRealVariance : doublereal

Name Type Description
doublereal
doublereal
function DoubleRealVariance( : DoubleReal,  : DoubleReal) : DoubleReal

Float : real

Returns a random float in the range [0,1]. |Name|Type|Description| |---|---|---|

function Float() : Real

FloatVariance : real

Returns a float in the range [base - variance, base + variance]. |Name|Type|Description| |---|---|---| |base|real| | |variance|real| |

function FloatVariance(base : Real, variance : Real) : Real

Int : integer

Returns a random int in the range of [0, MaxInt]. |Name|Type|Description| |---|---|---|

function Int() : Integer

IntVariance : integer

Int in the range [base - variance, base + variance]. |Name|Type|Description| |---|---|---| |base|integer| | |variance|integer| |

function IntVariance(base : Integer, variance : Integer) : Integer

Probability : boolean

Takes a given probability that we get a true value. |Name|Type|Description| |---|---|---| |probOfTrue|real| |

function Probability(probOfTrue : Real) : Boolean

Quaternion : quaternion

Random unit length quaternion. This is also a unit quaternion. |Name|Type|Description| |---|---|---|

function Quaternion() : Quaternion

RandomContext : Void

constructor

Name Type Description
function RandomContext()

Range : real

A random float in the range [min,max]. |Name|Type|Description| |---|---|---| |min|real| | |max|real| |

function Range(min : Real, max : Real) : Real

RangeExclusiveMax : integer

Int in the range [min, max) |Name|Type|Description| |---|---|---| |min|integer| | |max|integer| |

function RangeExclusiveMax(min : Integer, max : Integer) : Integer

RangeInclusiveMax : integer

Int in the range [min, max]. |Name|Type|Description| |---|---|---| |min|integer| | |max|integer| |

function RangeInclusiveMax(min : Integer, max : Integer) : Integer

Real : real

Returns a random real in the range [0,1]. |Name|Type|Description| |---|---|---|

function Real() : Real

Real2 : real2

Randomly generates a Real2 with its length between min and max. |Name|Type|Description| |---|---|---| |minLength|real| | |maxLength|real| |

function Real2(minLength : Real, maxLength : Real) : Real2

Real3 : real3

Randomly generates a Real3 with its length between min and max. |Name|Type|Description| |---|---|---| |minLength|real| | |maxLength|real| |

function Real3(minLength : Real, maxLength : Real) : Real3

RealVariance : real

Returns a real in the range [base - variance, base + variance]. |Name|Type|Description| |---|---|---| |base|real| | |variance|real| |

function RealVariance(base : Real, variance : Real) : Real

Rotation : quaternion

Random rotation quaternion. This is the same as calling Quaternion() |Name|Type|Description| |---|---|---|

function Rotation() : Quaternion

UnitReal2 : real2

Generates a unit length Real2. |Name|Type|Description| |---|---|---|

function UnitReal2() : Real2

UnitReal3 : real3

Generates a unit length Real3. |Name|Type|Description| |---|---|---|

function UnitReal3() : Real3

UnitVector2 : real2

Generates a unit length Vec2. |Name|Type|Description| |---|---|---|

function UnitVector2() : Real2

UnitVector3 : real3

Generates a unit length Vec3. |Name|Type|Description| |---|---|---|

function UnitVector3() : Real3

Vector2 : real2

Randomly generates a Vec2 with its length between min and max. |Name|Type|Description| |---|---|---| |minLength|real| | |maxLength|real| |

function Vector2(minLength : Real, maxLength : Real) : Real2

Vector3 : real3

Randomly generates a Vec3 with its length between min and max. |Name|Type|Description| |---|---|---| |minLength|real| | |maxLength|real| |

function Vector3(minLength : Real, maxLength : Real) : Real3