Added setCollisionMap method.

This commit is contained in:
photonstorm 2017-08-18 16:47:10 +01:00
parent 17c24ef586
commit e35524a1f5

View file

@ -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.