So I’m kind of new to box2d in general... and I’m trying to make a pong game

Code: Select all
private RubeSceneLoader loader;
private RubeScene scene;
World world;
loader = new RubeSceneLoader();
scene = loader.loadScene(Gdx.files.internal("data/test.json"));
world = scene.getWorld();
world.setContactListener(new contactlistenerHandler());

second question

this problem have i been struggling with for a while now when the ball hits a paddle i need it to bounce off with an angel relative to where it hit the paddle ... but i can't figure out how to change the travel angel off my ball body

i Goth a working pong game but it aint using box2d ... in this program the return angel is calculated like this
Code: Select all
private float getReflectionAngle(Paddle paddle) {
float ballCenterY = ball.getY() + (ball.getHeight() / 2f);
float paddleCenterY = paddle.getY() + (paddle.getHeight() / 2f);
float difference = ballCenterY - paddleCenterY;
float position = difference / paddle.getHeight();
return BALL_REFLECT_ANGLE * position;
}

but i need a function to change the movement angel...
sorry for my bad english
