mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
changed Grid.create to accept an options object
This commit is contained in:
parent
14392b4a88
commit
eedd1f2a9c
1 changed files with 9 additions and 6 deletions
|
@ -12,18 +12,21 @@ var Grid = {};
|
|||
/**
|
||||
* Description
|
||||
* @method create
|
||||
* @param {number} bucketWidth
|
||||
* @param {number} bucketHeight
|
||||
* @param {} options
|
||||
* @return {grid} A new grid
|
||||
*/
|
||||
Grid.create = function(bucketWidth, bucketHeight) {
|
||||
return {
|
||||
Grid.create = function(options) {
|
||||
var defaults = {
|
||||
controller: Grid,
|
||||
detector: Detector.collisions,
|
||||
buckets: {},
|
||||
pairs: {},
|
||||
pairsList: [],
|
||||
bucketWidth: bucketWidth || 48,
|
||||
bucketHeight: bucketHeight || 48
|
||||
bucketWidth: 48,
|
||||
bucketHeight: 48
|
||||
};
|
||||
|
||||
return Common.extend(defaults, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue