v10.0.0
Migrates the seedRand
and randInt
functions to a new PRNG module. In so doing this breaks how seedRand
and randInt
works. It also updated the PRNG algorithm to use SplitMix32 instead of LCG and the string hashing algorithm from xfnv1a to MurmurHash3.
This release also updates TileEngine to support spacing
property and renames the frameMargin
property to margin
and updates it to mean margin around the tilesheet instead of margin between each frame.
Breaking Changes
- seedRand: no longer returns
rand
as a function but instead modifies the seed - tileEngine:
frameMargin
renamed tomargin
and means margin around the tilesheet
Features
- seedRand: also now accepts a string or defaults to the current time if no value is passed
- randInt: accepts a function as 3rd parameter which can be used to pass a function that can bias the random number
- randInt: uses
rand
function by default instead ofMath.random
so is affected by seeding the PRNG - rand: function that returns a seeded random number between 0 and 1
- getSeed: function that returns the current random seed value
- button,scene: expose the HTML node property
- gameObject: add angular velocity and acceleration
- tileEngine: support flipped and rotated tiles in Tiled
- tileEngine: support the
spacing
property for the whitespace between frames - button: allow adding the HTMLButton element to a container
- tileEngine: add
getPosition
function
Fixes
- gameLoop: prevent zombie frame when start is called twice
- gameLoop: emit tick event every update
- prevent scrolling page on element focus