Pong
To re-program the game Pong you need to consider a few basic variables. The speed of the ball must be kept constant and the slope of the ball must change accordingly when a ball hits an object. The actual slope of the line that the ball is traveling in can be determined by the Pythagorean theorem: A2 + B2 = C2. A is the change in the X axis per millisecond, B is the change in the Y axis per millisecond, and C is the slope of the line.
When the ball hits a flat surface the slope must change to allow the direction of the ball to change. When the ball hits a horizontal flat surface the change in Y must become negative and the change in X must stay the same. When the ball hits a vertical flat surface the change in X must become negative and the change in Y must stay constant. A more accurate game of Pong would include other variables such as a change in slope according to the velocity of the paddle at the moment that it hit the ball and where the ball hit the paddle (the edge or the center). These factors would change the velocity of the ball and would make the game more interesting, however they require much more math.
The previous post was posted from my cell phone while I was at school. I text messaged an email address that can be used to post to my blog. I thought of the ideas behind the making of Pong today after my friend asked how you would go about programming a game of Pong.
When the ball hits a flat surface the slope must change to allow the direction of the ball to change. When the ball hits a horizontal flat surface the change in Y must become negative and the change in X must stay the same. When the ball hits a vertical flat surface the change in X must become negative and the change in Y must stay constant. A more accurate game of Pong would include other variables such as a change in slope according to the velocity of the paddle at the moment that it hit the ball and where the ball hit the paddle (the edge or the center). These factors would change the velocity of the ball and would make the game more interesting, however they require much more math.
The previous post was posted from my cell phone while I was at school. I text messaged an email address that can be used to post to my blog. I thought of the ideas behind the making of Pong today after my friend asked how you would go about programming a game of Pong.


3 Comments:
A dude in my research group made a pong game using an FPGA board. He did the VGA signalling all manually, used a mouse on a ps/2 port for one of the inputs, and a mouse on the serial port for the other input. Was very cool.
By al, at 6:44 PM
You stole my idea! I was going to make pong. :) Oh well, I guess that is just your idea of trying to help me.
By Jeff, at 8:53 PM
this is al
al likes doughnuts
pong is like donuts
DoughNutS
By Anonymous, at 7:43 PM
Post a Comment
<< Home