Jump to content

[P2] How to collide with the world bounds harder?


Recommended Posts

Hi everyone,

   I'm new to Phaser, and I'm using P2 for my collision events. Now I'm justing doing a test in which a group of objects colliding with the world boundary.  It works fine but the objects lose a lot of energy and velocity when collides with the world boundary. I just want the objects to bounce back with same speed, like 'setBounce' in arcade. I've tried the following : 

1.  Set the restitution, but I can just see little difference between different restitution values. 

2. Contact Material. I referenced to this page   http://examples.phaser.io/_site/view_full.html?d=p2 physics&f=contact+material.js&t=contact material

    It looks fine but it seems that one contact material contains only one sprite? Is there any way to add a collision group to one contact material?


Or are there other ways to do this?


Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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