mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Add module love.math. Implements xorshift RNG.
Contains just a RNG for now, but may include other functionality (e.g.
transforms) later on.
New Functions:
-- as in the lua math library:
love.math.randomseed(number) -- set random seed
love.math.random() -- get random number in [0:1) (uniformly distributed)
love.math.random(high) -- get integer random number in [1:high]
love.math.random(low, high) -- get integer random number in [low:high]
-- additional functions
love.math.randnormal() -- get normally distributed number with zero mean
-- and unit variance
love.math.randnormal(o) -- get normally distributed number with zero mean
-- and standard deviation `o`
love.math.randnormal(m, o) -- get normally distributed number with mean `m`
-- and standard deviation `o`
This commit is contained in:
@@ -257,6 +257,7 @@ function love.init()
|
||||
image = true,
|
||||
graphics = true,
|
||||
audio = true,
|
||||
math = true,
|
||||
physics = true,
|
||||
sound = true,
|
||||
font = true,
|
||||
@@ -307,6 +308,7 @@ function love.init()
|
||||
"image",
|
||||
"font",
|
||||
"graphics",
|
||||
"math",
|
||||
"physics",
|
||||
} do
|
||||
if c.modules[v] then
|
||||
|
||||
Reference in New Issue
Block a user