Defold - PCG Random
PCG Random Number Generator Native Extension for the Defold Game Engine
This extension allow you to generate random numbers using minimal C implementation of PCG.
It uses entropy seed internally with fallback to time based seed. You can switch to Time based seed and remove the entropy by uncommenting/commenting a few lines on the source code, but I don't think it is necessary.
You can use PCG Random in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
Returns a 32 bit integer
Returns a 32 bit integer between min and max values.
Same as math.random(3,20)
math.random(90) => rnd.range(1, 90)
Returns a floating point between 0-1.
Same as math.random()
Toss a coin. Returns 0 or 1 (0 = 'H', 1 = 'T')
Roll the dice. Returns between 1-6