Search Tutorials
What this all does is it makes the ball move... it makes it switch directions when it hits the walls, speed up a little bit with each hit, and switch angles when it hits the paddle. The paddle part is the main part, what it does is it finds the distance the ball is from the middle of the paddle when it hits and makes that distance divided by 2 the new angle. Now this depends on the size of the paddle, if the paddle is very big, then it will make the ball go crazy when it hits near the edge and you may want it to be divided by a larger number.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|