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?


To change the velocityThreshold in libgdx you use this code


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.