Available since LÖVE 0.9.0
This function is not supported in earlier versions.
Creates a new RandomGenerator object which is completely independent of other RandomGenerator objects and random functions.
rng = love.math.newRandomGenerator( )
None
RandomGenerator rng
rng = love.math.newRandomGenerator( seed )
number seed
RandomGenerator rng
rng = love.math.newRandomGenerator( low, high )
number low
number high
RandomGenerator rng
Creates a new RandomGenerator object, then generates a number between 1 and 100 inclusive.
function love.load() rng = love.math.newRandomGenerator() randomNumber = rng:random(1,100) end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.math.newRandomGenerator