Jump to content

checking positions


dthrasher90
 Share

Recommended Posts

Here's a good way to do it using two rectangles:

https://phaser.io/examples/v2/geometry/rectangle-intersects

You could just use the bounds of the sprite instead of one of the rectangles, then check if intersects exists and has height/width to determine if a part of the sprite is within the target rectangle.  Furthermore, you could check to see if intersects has the same bounds as your sprite if you want to see if the sprite is all the way inside the rectangle.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...