phaser/v3/src/gameobjects/tilemap/components/HasTileAt.js

18 lines
332 B
JavaScript
Raw Normal View History

2017-11-16 19:09:07 +00:00
var IsInLayerBounds = require('./IsInLayerBounds');
var HasTileAt = function (tileX, tileY, layer)
{
2017-11-16 19:09:07 +00:00
if (IsInLayerBounds(tileX, tileY, layer))
{
var tile = layer.data[tileY][tileX];
return (tile !== null && tile.index > -1);
}
else
{
return false;
}
};
module.exports = HasTileAt;