Pong-How to make the ball bounce on impact.

I am making a pong clone and i was wondering how to make the ball bounce off the paddles.If you know how, please help me!!


Comments

  • : I am making a pong clone and i was wondering how to make the ball bounce off the paddles.If you know how, please help me!!




    Well, you have to do collision detection. Lets take the following ascii picture:


    (ball)(direction)

    * --->


    Just split the vector in it's x and y components

    and do a check in both direction, and also the original direction, if you detect a paddle, then

    just bounce in the opposite direction, or something.....


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories