RandomGenerator

A RandomGenerator is a standalone object that can be used to independently generate pseudo-random numbers. If you just need basic randomness, you can use lovr.math.random without needing to create a random generator.

Constructor

lovr.math.newRandomGeneratorCreate a new RandomGenerator.

Methods

RandomGenerator:getSeedGet the seed value of the RandomGenerator.
RandomGenerator:setSeedReinitialize the RandomGenerator with a new seed.
RandomGenerator:randomGet a random number.
RandomGenerator:randomNormalGet a random number from a normal distribution.
RandomGenerator:getStateGet the current state of the RandomGenerator.
RandomGenerator:setStateSet the state of the RandomGenerator.

See also