dthrasher90 Posted April 20, 2017 Share Posted April 20, 2017 is there a way to check if a sprite has entered an area? ie. has a sprite came into a zone from x,y pixels by x,y pixels? Link to comment Share on other sites More sharing options...
Cudabear Posted April 20, 2017 Share Posted April 20, 2017 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. samme 1 Link to comment Share on other sites More sharing options...
Recommended Posts