phaser/src/tilemaps/components/SetTileCollision.js

24 lines
540 B
JavaScript
Raw Normal View History

2017-11-27 13:33:30 +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]
*/
var SetTileCollision = function (tile, collides)
{
if (collides)
{
tile.setCollision(true, true, true, true, false);
}
else
{
tile.resetCollision(false);
}
};
module.exports = SetTileCollision;