From e35524a1f52ca6722cacffea1ded5581072196f6 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 18 Aug 2017 16:47:10 +0100 Subject: [PATCH] Added setCollisionMap method. --- v3/src/physics/impact/World.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v3/src/physics/impact/World.js b/v3/src/physics/impact/World.js index c92f57b00..06b96bf5a 100644 --- a/v3/src/physics/impact/World.js +++ b/v3/src/physics/impact/World.js @@ -5,7 +5,6 @@ var Class = require('../../utils/Class'); var COLLIDES = require('./COLLIDES'); var CollisionMap = require('./CollisionMap'); var GetFastValue = require('../../utils/object/GetFastValue'); -var GetValue = require('../../utils/object/GetValue'); var Set = require('../../structs/Set'); var Solver = require('./Solver'); var TYPE = require('./TYPE'); @@ -93,6 +92,13 @@ var World = new Class({ } }, + setCollisionMap: function (tilesize, data) + { + this.collisionMap = new CollisionMap(tilesize, data); + + return this; + }, + /** * Sets the bounds of the Physics world to match the given world pixel dimensions. * You can optionally set which 'walls' to create: left, right, top or bottom.