Skip to content

Commit eedd1f2

Browse files
committed
changed Grid.create to accept an options object
1 parent 14392b4 commit eedd1f2

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/collision/Grid.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ var Grid = {};
1212
/**
1313
* Description
1414
* @method create
15-
* @param {number} bucketWidth
16-
* @param {number} bucketHeight
15+
* @param {} options
1716
* @return {grid} A new grid
1817
*/
19-
Grid.create = function(bucketWidth, bucketHeight) {
20-
return {
18+
Grid.create = function(options) {
19+
var defaults = {
20+
controller: Grid,
21+
detector: Detector.collisions,
2122
buckets: {},
2223
pairs: {},
2324
pairsList: [],
24-
bucketWidth: bucketWidth || 48,
25-
bucketHeight: bucketHeight || 48
25+
bucketWidth: 48,
26+
bucketHeight: 48
2627
};
28+
29+
return Common.extend(defaults, options);
2730
};
2831

2932
/**

0 commit comments

Comments
 (0)