From eedd1f2a9c02ddb601ceae2f8036ee3c0acb19c3 Mon Sep 17 00:00:00 2001 From: liabru Date: Sat, 21 Jun 2014 19:18:35 +0100 Subject: [PATCH] changed Grid.create to accept an options object --- src/collision/Grid.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/collision/Grid.js b/src/collision/Grid.js index 72c83f2..4d7ace1 100644 --- a/src/collision/Grid.js +++ b/src/collision/Grid.js @@ -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); }; /**