Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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?
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.