Mario Posted January 16, 2014 Share Posted January 16, 2014 Hi, is it possible to check if a sprite collides with others while dragging it? I am trying to build a game where you can rearange items, but physics/collision detection seems to be deactivated for the dragged sprite. Therefore items will overlap. I need a solution to prevent overlapping. Anything included in Phaser? So far I tried this:game.physics.collide(group, group);It works as expected for falling items, but not while dragging. Thank youMario Link to comment Share on other sites More sharing options...
rich Posted January 16, 2014 Share Posted January 16, 2014 I would use game.physics.overlap() instead and then you'll need to handle what happens if they do overlap yourself really. Collide is meant to work across body motion, of which a sprite doesn't currently have any while being dragged. When we integrate p2.js later on you'll finally be able to do this though, but not yet. Link to comment Share on other sites More sharing options...
Mario Posted January 20, 2014 Author Share Posted January 20, 2014 Thank you. I’m looking forward to p2.js! :-) Link to comment Share on other sites More sharing options...
bilginhalil Posted March 6, 2014 Share Posted March 6, 2014 I would use game.physics.overlap() instead and then you'll need to handle what happens if they do overlap yourself really. Collide is meant to work across body motion, of which a sprite doesn't currently have any while being dragged. When we integrate p2.js later on you'll finally be able to do this though, but not yet. when will you integrate p2.js ? Link to comment Share on other sites More sharing options...
rich Posted March 7, 2014 Share Posted March 7, 2014 We have! it's been in the 1.2 branch for a while now. Link to comment Share on other sites More sharing options...
bilginhalil Posted March 7, 2014 Share Posted March 7, 2014 We have! it's been in the 1.2 branch for a while now. so how can i use it ? game.physics.collide(); is not working :/ i need something like @Mario Link to comment Share on other sites More sharing options...
Recommended Posts