0
\$\begingroup\$

I'm still making this air hockey game. I have it mostly there now, but the dynamic body which is the puck always sticks to the walls (static body rectangles that form the border of the table).

I read on box2d forums that there is a setting called b2_velocityThreshold, which needs to be set to 0 for games like billiards. I'm assuming that would help me, here, but I can't find any such setting in libgdx box2d.

Is there any setting which I can change to allow the puck to bounce off the walls? If not, how should I go about making such a game in libgdx?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

To change the velocityThreshold in libgdx you use this code

World.setVelocityThreshold(0f);
\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .