Movement script

Does anymore know how to write up a movement script for a box2d C++ code. I literally have no idea how to code it

Is this related to the Pong question? Box2D is overkill for Pong. It's like using a Saturn V rocket as an elevator in a ten-story building. You could do it, but you're only making things way harder than they need to be.

Pong consists of five main parts:
1. Detecting when the ball hits a paddle. This is just a circle-segment collision, which is really simple, or possibly even a point-segment collision which is as simple as it gets.
2. Altering the course of the ball depending on how it hits the paddle. There's multiple ways to implement this depending on how many variables you want to consider. In the simplest solution the ball always bounces back the same way no matter how it hits the paddle.
3. Bouncing the ball when it hits the non-scoring edges of the screen.
4. Making the ball follow its trajectory. Simple linear motion.
5. Detecting when the ball hits a scoring edge.
No this is for something else. I'm trying to make a 2d platformer game with box2d and i want to give my circle(which is meant to be my player) some controls but I don't know how to go about it
Topic archived. No new replies allowed.