phaser/src/tilemaps/components/SetTileCollision.js

21 lines
448 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
*
* @param {Tile} tile - [description]
* @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;