2018-02-12 16:01:20 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
2017-11-27 13:33:30 +00:00
|
|
|
/**
|
2018-01-29 22:51:08 +00:00
|
|
|
* Internally used method to set the colliding state of a tile. This does not recalculate
|
|
|
|
* interesting faces.
|
2017-11-27 13:33:30 +00:00
|
|
|
*
|
2018-02-08 01:08:59 +00:00
|
|
|
* @function Phaser.Tilemaps.Components.SetTileCollision
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Tilemaps.Tile} tile - [description]
|
2017-11-27 13:33:30 +00:00
|
|
|
* @param {boolean} [collides=true] - [description]
|
|
|
|
*/
|
2017-11-21 02:06:49 +00:00
|
|
|
var SetTileCollision = function (tile, collides)
|
|
|
|
{
|
|
|
|
if (collides)
|
|
|
|
{
|
2018-01-29 22:51:08 +00:00
|
|
|
tile.setCollision(true, true, true, true, false);
|
2017-11-21 02:06:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-01-29 22:51:08 +00:00
|
|
|
tile.resetCollision(false);
|
2017-11-21 02:06:49 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = SetTileCollision;
|