Mercurial > love-experiments
diff src/scripts/boot.lua @ 1323:20219e80cb9f
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`
| author | vrld <vrld@vrld.org> |
|---|---|
| date | Mon, 25 Feb 2013 18:32:54 +0100 |
| parents | b7f097053d74 |
| children | 730ed5f01ab0 |
line wrap: on
line diff
--- a/src/scripts/boot.lua Tue Feb 19 14:21:01 2013 -0400 +++ b/src/scripts/boot.lua Mon Feb 25 18:32:54 2013 +0100 @@ -257,6 +257,7 @@ image = true, graphics = true, audio = true, + math = true, physics = true, sound = true, font = true, @@ -307,6 +308,7 @@ "image", "font", "graphics", + "math", "physics", } do if c.modules[v] then
