Jump to content

Phaser 2.6.2 colliding with two objects from separate parent groups?


Recommended Posts

Hey I've been trying to use Arcade Physics in order to do collision between two objects.   I set the two objects physics using:


where physics base is a sprite in a whole list of children in a group object with collision enabled. I made a class the extended group in order to contain references to specific children. I made two of these objects and tried to do the following:

this.boat1.physicsBody.onCollide = new Phaser.Signal();
this.boat1.physicsBody.onCollide.add(hitCollision, this);

I do this for only one group object (though this should still work?) 

after that in update I do 

this.game.physics.arcade.collide(this.boat1.physicsBody, this.boat2.physicsBody);

and then set hit collision to 

function hitCollision(boat1, boat2){

however I see no "hit" string in the log, indeed nothing shows up at all when the objects are clearly overlapped. 

I'm not sure how to actually get collision enabled, and how to actually move the two entities when hitting each other, apparently body.mass is used in imparting momentum, but I don't see how to make sure that momentum is imparted (unless bounce is what it is talking about?) 


Link to comment
Share on other sites


  • Recently Browsing   0 members

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