pinkpanther Posted July 14, 2014 Share Posted July 14, 2014 Hello, I want to have many collision groups or detect, which object was collided.E.g. I need ammo box to be collided against player, which add him ammo, but when the ammo box collides against projectile, the player shouold not get ammo.Is there any way to establish more than one collision group or to detect from collide method collided object? Regards :-) Quote Link to comment Share on other sites More sharing options...
enpu Posted July 14, 2014 Share Posted July 14, 2014 collide method should give you a body that it collided with as a parameter. collide: function(body) {} Quote Link to comment Share on other sites More sharing options...
pinkpanther Posted July 14, 2014 Author Share Posted July 14, 2014 Thanks! Worked fine for me. I added a name field and check body.name Quote Link to comment Share on other sites More sharing options...
enpu Posted July 14, 2014 Share Posted July 14, 2014 Nice! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.