Deplicator

P2 Collisions and Callbacks

Recommended Posts

I have a simple space ship shooter game and I have a question about collisions and grouping them.

I'm familiar with the collisions groups, impact events and postbroadphase callback P2 examples.

Setting collision groups to have ships bounce off walls and each other is like the examples. When I add bullets to a group they bounce around too; off walls and push ships around. The result of the impact happens before the bullet sprite is killed.

Bullets act as expected using a postbroadphase callback, but that callback fires anytime anything collides with anything. Is this the correct way to handle this? Is there a way to stop impact events using collision groups?

I've googled the hell out of this, but maybe some keyword to point me in the right direction eludes me. Thanks for any help.

 

 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.