Jump to content
  • Advertisement
Sign in to follow this  
greencrayon

Pong Paddle Physics Problem

This topic is 4149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi folks. I am looking for some help with bounce physics for my Pong clone using XNA and C#. The way my game works at the moment is when the ball hits the paddle it is deflected at a random speed. This works just fine but I would like to have the ball deflected at a speed based on the speed the paddle was moving at when it collided with the ball. How would I approach this problem? My program takes the position of the ball and the paddle for each frame, so in the frame in which the collision takes place the computer sees both sprites as stationary… Doesn’t it? I hope this is not too vague. I am not looking for specific code help, more of a pointer in how to approach the problem. Thankyou for your time.

Share this post


Link to post
Share on other sites
Advertisement
I did this super simple in my pong game by just taking ballSpeed *= (Abs(paddleSpeed) / constant)

This is probably a really really bad way of doing it, but it worked ok for me.

Good luck :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!