Here is my problem:
1. Each ball must move at a random speed in each of the X- and Y-directions, which speed may vary between 0 and 5 pixels per direction when the instance is created but stays constant for the lifetime of the ball.
2.The balls must bounce off the edges of the world in such a way that the angle of incidence equals the angle of reflection.
I am struggling the most with the second problem. Any help will be appreciated.
Thanks.
