On Monday, 14-August-2006 at 20:39:42 trekkie576 wrote,
>I am new to the whole programming concept, and I was wondering if
>anyone knows the proper code for a pong game. Any websites would be
>helpfull also.
I don't think there's 'proper' code as such for the game. It'd need to be
different for every language it was written in, and different programmers would
write it differently in the same language.
My approach would be to start by working out how to draw a bat in a window.
Then how to position it differently, then how to move it up and down using the
keyboard or mouse.
Then draw the ball, then work out how to change its position from within a loop,
so it appears to be moving in a straight line. Then figure out how to detect
when the ball hits the edge of the window. Then how to detect when it hits the
bat, and how you should bounce the ball.
And finally, add a second bat, but under computer control, like the ball is.