fatcat Posted December 12, 2013 Share Posted December 12, 2013 Hi, I was going through the docs searching for a "smart way" or built in method to detect when a Sprite "collides" with the game world's bounds ...I saw that there was the game.physics.collidemethod (as far as I saw in the examples it works with Sprite and I'm probably wrong) but I don't have a Sprite on the "bottom/floor" of my game.Is that possible or should I just check the Sprite's position.y value to do that (or is there a callback)?Thanks Link to comment Share on other sites More sharing options...
Zaidar Posted December 12, 2013 Share Posted December 12, 2013 What if you just use the sprite.position.x + sprite.width and test if game.world.width is between these values ? (for the right side) Link to comment Share on other sites More sharing options...
rich Posted December 12, 2013 Share Posted December 12, 2013 Sprites have an event for when they go out of the world bounds. What I would do is listen for this and then act accordingly, i.e. reflect them back in again, destroy them, etc. Zaidar 1 Link to comment Share on other sites More sharing options...
fatcat Posted December 13, 2013 Author Share Posted December 13, 2013 Great thanks, I'll check those events Link to comment Share on other sites More sharing options...
Recommended Posts