PyBreakout - a Breakout clone written in Python
Monday October 09th 2006, 8:16 pm
Filed under: Development, Python

PyBreakout - a Breakout clone written in Python using the Pygame libraries

I created this little game using Python 2.4.3, Pygame 1.7.1, and finally created the .exe distribution using py2exe 0.6.

This is my second project that I have done with the awesome Pygame Libraries and I plan to continue this project based on user feedback, so let me know what needs to be tweaked.

What’s the goal of the game?

  1. You are a paddle that can move left and right, you launch the ball from your paddle by pressing “SPACE”
  2. The goal of the game is simple, just keep the ball from falling into the abyss beneath you and hit all of the destructible blocks on the level to advance and gain points.
  3. You have 3 lives when you start the game.
  4. During the level your ball will increase in speed every 15 seconds, until it reaches a pretty quick max speed.
  5. You will be awarded a new life if you acquire 500 pts, and another at 2000 pts.

How do I control the game?

  1. Enter/Return - Reset the ball ( Looses 1 life )
  2. Spacebar- Launch the ball off the paddle
  3. Arrow Left - Move the paddle left
  4. Arrow Right - Move the paddle right

How to launch PyBreakout ( only tested on WinXP, sorry )

Checkout the latest Source Code from Google Code’s Subversion Repository

  1. Get TortoiseSVN or Eclipse with the Subclipse plugin and the PyDev plugin or a suitable Subversion client…
  2. Follow the directions on the Source Tab of the Pybreakout page

Windows XP/2000

  1. Download the pybreakout-windows.zip file
  2. Unzip this pybreakout-windows.zip to a suitable location, desktop or where ever
  3. Double-click on pybreakout.exe within that directory and it should work!

*Nix / Mac

  1. Download the pybreakout-src.zip source code file
  2. Unzip this pybreakout-src.zip to a suitable location.
  3. Assuming that you have Python 2.4 and Pygame installed correctly, simply type “python pybreakout.py” at the command prompt in the src/ directory and it should work.
  4. View and critique the source code and drop me a line on how sweet it is…

Game Notes

After some gentle poking and prodding from my boy Chryso on this here forum, I decided that Pygame was cool enough and easy enough so that I would pound out PyBreakout in about a weeks time… even being out of town all week

This project is much more ambitious and more fun than Avoidgame so I am going to keep it up and tweak it until it is pretty sweet. But this current version should be quite playable.

Check it out, and let me know what you think or…

Discuss it in the forum