phaser/v3/src/gameobjects/tilemap/components/HasTileAt.js
2017-11-16 13:09:07 -06:00

17 lines
332 B
JavaScript

var IsInLayerBounds = require('./IsInLayerBounds');
var HasTileAt = function (tileX, tileY, layer)
{
if (IsInLayerBounds(tileX, tileY, layer))
{
var tile = layer.data[tileY][tileX];
return (tile !== null && tile.index > -1);
}
else
{
return false;
}
};
module.exports = HasTileAt;