mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Add note about circle bodies not currently being supported in Arcade tile intersection
This commit is contained in:
parent
d554d61319
commit
15825eacb3
1 changed files with 9 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue