CharlesCraft50 Posted December 26, 2016 Share Posted December 26, 2016 How to detect the object from group when collided to player in p2. like: Quote this.body.collides(blockCollisionGroup, function(obj1, obj2){obj2.kill();}); Arcade child from group ex: Quote group.forEachAlive(function(child) { game.physics.arcade.collide(player, child, function(obj1, obj2){ obj2.kill(); }); Link to comment Share on other sites More sharing options...
charlie_says Posted December 26, 2016 Share Posted December 26, 2016 not sure this will help, but I approached it in a slightly different way. ball.body.onBeginContact.add(this.contactHandler); // The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A, the p2 Shape from Body B and the contact equations array contactHandler: function(phaserP2Body, p2Body, shapeA, shapeB, equArray) { Link to comment Share on other sites More sharing options...
CharlesCraft50 Posted December 27, 2016 Author Share Posted December 27, 2016 Can you explain your code a little bit, Thanks Link to comment Share on other sites More sharing options...
Recommended Posts