Jump to content

Phaser p2 select child from group


CharlesCraft50
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

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