I'm new with this beautiful library. To learn how to use it I just want a ball to bounce on the left/right walls and stick on the top wall. And when I throw another ball, I want it to stick with other balls, and top wall but bounce on the left/right walls.
To do this I tried two things:
1) Playing with elasticity and friction coefficient, but I dosn't work.
2) I use cpSpaceAddCollisionPairFunc to detect the collision with the top wall, then I set the velocity of the ball to 0 and I remove the collisionPairFunc (to save cpu?!) It's OK.
I add another addCollisionPairFunc to detect collision between two balls and set their velocity to 0 but it doesn't work the way I want
Can someone explain me the best way to do this ?