RandomDataGenerator#between()

between(min, max) → {number} Returns a random integer between and including min and max.This method is an alias for RandomDataGenerator.integerInRange. Parameters Name Type Description min number The minimum value in the range. max number The maximum value in the range. Returns number - A random number between min and max. Source code: math/RandomDataGenerator.js (Line 198)

RandomDataGenerator#angle()

angle() → {number} Returns a random angle between -180 and 180. Returns number - A random number between -180 and 180. Source code: math/RandomDataGenerator.js (Line 310)

QuadTree#split()

split() Split the node into 4 subnodes Source code: math/QuadTree.js (Line 130)

QuadTree#retrieve()

retrieve(source) → {array} Return all objects that could collide with the given Sprite or Rectangle. Parameters Name Type Description source Phaser.Sprite | Phaser.Rectangle The source object to check the QuadTree against. Either a Sprite or Rectangle. Returns array - Array with all detected objects. Source code: math/QuadTree.js (Line 247)

QuadTree#reset()

reset(x, y, width, height, maxObjects, maxLevels, level) Resets the QuadTree. Parameters Name Type Argument Default Description x number The top left coordinate of the quadtree. y number The top left coordinate of the quadtree. width number The width of the quadtree in pixels. height number The height of the quadtree in pixels. maxObjects number <optional> 10 The maximum number of objects per node. maxLevels number <optional> 4 The maximum number

QuadTree#QuadTree

new QuadTree(x, y, width, height, maxObjects, maxLevels, level) A QuadTree implementation. The original code was a conversion of the Java code posted to GameDevTuts.However I've tweaked it massively to add node indexing, removed lots of temp. var creation and significantly increased performance as a result.Original version at https://github.com/timohausmann/quadtree-js/ Parameters Name Type Argument Default Description x number The top left coordinate of the quadtree. y number Th

QuadTree#populateHandler()

populateHandler(sprite) Handler for the populate method. Parameters Name Type Description sprite Phaser.Sprite | object The Sprite to check. Source code: math/QuadTree.js (Line 115)

QuadTree#populate()

populate(group) Populates this quadtree with the children of the given Group. In order to be added the child must exist and have a body property. Parameters Name Type Description group Phaser.Group The Group to add to the quadtree. Source code: math/QuadTree.js (Line 103)

QuadTree#objects

objects :array Array of quadtree children. Source code: math/QuadTree.js (Line 50)

QuadTree#nodes

nodes :array Array of associated child nodes. Source code: math/QuadTree.js (Line 55)