pygame is
Simple DirectMedia Layer is
Site Swing

PongClone - 3

Hayden Dennison (hidas)



This small game uses pygame.draw() for every game object except for the fonts and display. It should work on any operating system that supports pygame and python. (no os.path.join!) It's released under the GNU General Public License.


Updated version with better ball physics, smaller ball, 16-pixel buffer against wall. Also fixed an unfair advantage where the right-side paddle was closer to the wall, thereby giving it 10 pixels more to catch the ball. Still no sound until I figure out a way to squeeze it into one source code file. (the goal of this project)


Home Page:


click to view original size


PongClone - 4 - Jan 20, 2011
PongClone - 3.1 - Jan 11, 2011
PongClone - 3 - Jan 9, 2011
PongClone - 2 - Jan 8, 2011 account Comments

If you wish to leave a comment with your account, please sign in first.

February 25, 2011 6:08pm - Zachariah Callaway - nickname: (xzcallaway)
A .deb package of Pong Clone is available for download at on the Arcade page.
January 18, 2011 8:48am - Hayden Dennison - nickname: (hidas)
Thanks, Chris!

1. Yes, the ball just reverses direction whenever it hits either paddle. I'll have to add some code that detects whether it's stuck inside a paddle and adjust accordingly.

2. The AI moves at a steady 5 pixels when the ball is under or over it's centery. As you said, it stops and starts when the ball's yspeed is under 5 pixels.

3. Yep. My goal for this project was to have sound, images, and things dynamically generated within the code, but I'm going to scrap this to add some sound and a menu, since two people have asked for it so far.

Again, thanks for the comment, your opinion, and the good score. :)
January 17, 2011 2:22am - Chris - nickname: (cng1024) - 3/5
I played the Atari Pong game as a kid, and I must say, this appears to be a pretty good recreation.

I rated it 3/5 because it does have some bugs.

1) If you hit the ball with the top or bottom of the paddle, the ball gets 'stuck' for about 250ms before moving again. Your collision detection needs a bit of a tweak there.

2) The ai opponent paddle's motion appears 'jittery' when the ball's vertical motion is slow. I didn't take a really good look at the code, but it appears to be a side effect of the paddle's perfection in countering any vertical movement the ball makes. It could be fixed by adding a threshold value to the calculations. If the ball's y-coordinate gets outside a +/- range of so many pixels, have the ai counter the ball's movement. Perhaps shrink the threshold as the ball's speed increases?

3) This isn't really a bug, but it might be nice to shine the game up some. I wouldn't do a thing to the graphics or game play, but it would be nice if there was that classic 'thunk' sound when the ball is hit and a simple menu would just be icing on the cake.

Aside from these small issues, its a very nice game. Falls into that addictive category for me anyway. :-)
January 8, 2011 2:24pm - Maxime - nickname: (spacemax) - 3/5
It's working fine. Just add some sound and why not some features.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)