Add note about circle bodies not currently being supported in Arcade tile intersection

This commit is contained in:
Michael Hadley 2018-01-12 10:52:40 -06:00
parent d554d61319
commit 15825eacb3

View file

@ -1,18 +1,14 @@
var TileIntersectsBody = function (tileWorldRect, body)
{
if (body.isCircle)
{
return false;
}
else
{
return !(
body.right <= tileWorldRect.left ||
body.bottom <= tileWorldRect.top ||
body.position.x >= tileWorldRect.right ||
body.position.y >= tileWorldRect.bottom
);
}
// Currently, all bodies are treated as rectangles when colliding with a Tile. Eventually, this
// should support circle bodies when those are less buggy in v3.
return !(
body.right <= tileWorldRect.left ||
body.bottom <= tileWorldRect.top ||
body.position.x >= tileWorldRect.right ||
body.position.y >= tileWorldRect.bottom
);
};
module.exports = TileIntersectsBody;