0

On Pset4 "bounce" walkthrough, I learnt how the ball bounces horizontally. Can anyone please help me in bouncing the ball at angles after it touches the window edges and paddle?

1 Answer 1

2

The trajectory of the ball is a composition of x-velocity and y-velocity. if you invert one of them (from positive to negative) when you hit an obstacle, the relative movement of the ball will be inverted as well.

2
  • did you just answer your own question?
    – lethaljd
    Commented Aug 1, 2014 at 18:54
  • Yes. In other words, I found a question that was asked many times, and decided to publish and answer it on StackExchange to give a solid pointer to other students.
    – Cygni_61
    Commented Aug 2, 2014 at 7:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .