Jump to content

Is there anything like bounce in P2


Recommended Posts

Hello :)


Is there anything like bounce in Arcade Physics.... in P2 Physics?


I can simply bounce two objects on collision in Aracde, but I cannot generate something like that in P2!

I've defined collisions, bodies.... but I cannot generate what I want.


I can change velocity to simulate bouncing, but I cannot find collide direction to simulate it correctly!


In my sample, I don't want to have any gravity and friction.


Thanks a lot. :rolleyes:

Link to comment
Share on other sites

The magic word you're searching for is restitution. This is a property you can set on a contact equation during a collision. To make this easy, phaser and p2 defines materials which defines the behaviour of collisions between to objects. For bounciness restitution needs to be greater than 0. 0 is no bounce at all.


P2's example from schteppe



Phaser also has an example of contact materials



Have fun!

Link to comment
Share on other sites


  • Recently Browsing   0 members

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