Skip to content

Commit

Permalink
changed Grid.create to accept an options object
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jun 21, 2014
1 parent 14392b4 commit eedd1f2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/collision/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down

0 comments on commit eedd1f2

Please sign in to comment.