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
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.
-
-
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_61Commented Aug 2, 2014 at 7:58