# Physics in carrom like game using cocos2d + Box2D

I am working on carrom like game using cocos2d + Box2D. I set world gravity(0,0), want gravity in z-axis. I set following values for coin and striker body:

Coin body (circle with radius - 15/PTM_RATIO):

``````density = 20.0f;
friction = 0.4f;
restitution = 0.6f;
``````

Striker body (circle with radius - 15/PTM_RATIO):

``````density = 25.0f;
friction = 0.6f;
restitution = 0.3f;
``````

Output is not smooth. When I apply `ApplyLinearImpulse(force,position)` the coin movement looks like floating in the air - takes too much time to stop.

What values for coin and striker make it look like real carrom?

-
For anyone that doesn't know the game: en.wikipedia.org/wiki/Carrom – Ray Dey Nov 28 '11 at 12:12
Study some physics and figure it out mathematically. (Worth having some general knowledge in that area anyway if you're a game developer) – doppelgreener Nov 28 '11 at 23:00
@Jonathan Hobbs Not really fair as the issue here is related to the library and no amount of correct math would fix the problem out side of making his own engine, – ClassicThunder Feb 9 '12 at 23:42

Box2D comes with a FrictionJoint. From the docs:

The friction joint is used for top-down friction. The joint provides 2D translational friction and angular friction.

As far as I know it doesn't really matter what you attach your physics-bodies to (using the joint). So you could attach them all to a border of the play-board and tweak the friction/torque settings until it looks realistic.

-
Use `setDamping`. It acts as air resistance.
``````object.setDamping(10.4);