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.
|» Level Intermediate|
Rating: 5.79 Votes: 24
|Use this tutorial to make a game like breakout or pong, i have a version of pong on my cheap as free website, check it out|
|Download the files used in this tutorial.|
|Download (0 kb)|
|More help? Search our boards for quick answers!|