natedawson.com Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
PyBreakout

 
Reply to topic    natedawson.com Forum Index » Python View previous topic
View next topic
PyBreakout
Author Message
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post PyBreakout Reply with quote
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 is the current version?

The current version, which this document describes, is pybreakout 0.3 released on 2006/10/19 .


What's the goal of the game?


  • You are a paddle that can move left and right, you launch the ball from your paddle by pressing the LEFT mouse button.
  • 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.
  • You have 3 lives when you start the game.
  • During the level your ball will increase in speed every 15 seconds, until it reaches a pretty quick max speed.
  • You will be awarded a new life if you acquire 500 pts, and another at 1500 pts.



How do I control the game?


  • Press ESC to End game
  • Right or Middle click the mouse - Reset the ball ( at the cost of 1 life )
  • Left click the mouse- Launch the ball off the paddle
  • Move Mouse left within the Pygame window- Move the paddle left
  • Move Mouse right within the Pygame window - Move the paddle right



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

Windows XP/2000

  1. Download the pybreakout-0.3-win.zip.
  2. Unzip this pybreakout-<currentVersion>-win.zip to a suitable location, your Desktop or where ever you want.
  3. Double-click on pybreakout.exe within the newly unzipped directory and start playing!


*Nix / Mac

  1. Download the pybreakout-0.3-src.zip
  2. Unzip this pybreakout-<currentVersion>-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...




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




Game Notes


Version 0.3 Notes
I have added several cool features in this release but probably the most exciting is:
POWERUPS! I have successfully implemented both a Slowball powerup as well as a Triball powerup.

Here are all the changes in this version:

  • Created a Triball Bonus which splits your main ball into 2 additional balls. You can get this powerup several times and have some real fun with many balls.
  • Created a Slowball Bonus which slows all balls on the board down to the slowest speed. Very helpful on higher levels.
  • These bonuses occur randomly when destroying bricks
  • Many improvements to the Mouse Control, and capture of the cursor when the game is primary focused.
  • Added ESC key to end game at any time (because you can no longer hit the "X")
  • The paddle now has five zones of redirection for more control over where you will redirect the balls.
  • Each successful level begins at a higher speed until you have reset to level 0
  • Now even GREY BRICKS are destructible once they have been hit 4 times. This was needed to avoid some infinite ball loops in the levels.
  • I have used the --bundle flag in py2exe so that it has a much more organized distribution
  • I spent some time refactoring and improving the codebase during this period especially when I had to account for several balls instead of only one ball on the board.



Version 0.2 Notes

I have added several features to this release including:

  • Mouse Control of paddle Left and Right
  • Mouse Control - Left Click (strictly pygame's button1) to launch the ball
  • Mouse Control - Right Click or Middle Click (strictly pygame's button2 or button3) to use next life
  • Improved ball redirection based on where it hits the paddle, if the ball hits the left 10px of the paddle it is redirected up and left, middle 20 px it is reflected, right 10 px it is always reflected up and right. This improves directional control of ball.
  • Sound Effects - for bouncing off gameboard walls, destroying blocks, bouncing off paddle, bouncing off indestructible blocks, and when you get extra lives
  • Reset speed to 1 ( rather slow ) when you advance to next level instead of leaving it at whatever speed you passed the previous level at.


Thanks to Peter Nosgoth for trying the game out and giving me some pointers on how to improve it on the Pygame page


Version 0.1 Notes

Version 0.1 is available as src only.

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 playable.

Check it out, and let me know what you think!


Last edited by npdawson on Sun Jul 08, 2007 9:52 am; edited 4 times in total
Mon Oct 09, 2006 8:03 pm View user's profile Send private message Visit poster's website
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post Reply with quote
I created a page for this game on the PyGame website, check it out.

PyBreakout game
Tue Oct 10, 2006 12:03 pm View user's profile Send private message Visit poster's website
chryso
Omni-usurper


Joined: 25 Sep 2006
Posts: 18
Location: Flar-eeee-da

Post Reply with quote
This makes me very happy, just so you know. Beautiful simplicity.

Did you look at the pygame.org page you made for PyBreakout? There is already a dude on there hating on your creation. Just kidding, he actually offers a few useful suggestions (without any sort of explanation, my favorite kind).

I am impressed, sir. Keep up the good pygame work.

-C.
Tue Oct 10, 2006 7:06 pm View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post Reply with quote
Thanks for the heads up.

I don't mind getting feature requests like that. I think it is pretty sweet that someone else even took the time to play the game!

Actually I am knee deep in Version 0.2 that is incorporating his changes. So if you checkout from Google Code repository don't be surprised if it doesn't correspond to the documentation.

Oh, and did you happen to notice anything about the level designs?
Wed Oct 11, 2006 9:36 am View user's profile Send private message Visit poster's website
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post PyBreakout Version 0.2 is out Reply with quote
I have updated the top post to reflect the changes. The big change is in moving from Keyboard Control to Mouse Control.

Oh yeah, and Sound Design is hard. Not implementing it in Pygame... that was easy. But actually finding some sounds that don't really get on your nerves, that is HARD.
Wed Oct 11, 2006 10:04 am View user's profile Send private message Visit poster's website
chryso
Omni-usurper


Joined: 25 Sep 2006
Posts: 18
Location: Flar-eeee-da

Post Reply with quote
I can't wait to play networked PyBreakout.

Using the mouse will be nice. Are you making it sensitive to the degree of change?
Wed Oct 11, 2006 8:36 pm View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post Reply with quote
Version 0.2 just follows you mouse cursor's x_position at a 1:1 ratio, while over the gameboard.

Version 0.3 still under dev, although it is in the repo... uses the same technique but incorporates some nifty features to grab control of the cursor, so that you don't even see your mouse cursor when the game is in focus. Now you can quit the game with the "ESC" key. I have also fixed a couple bugs that I came across while testing. I am not going to release Version 0.3 until I get some bonuses though. Smile
Fri Oct 13, 2006 2:09 pm View user's profile Send private message Visit poster's website
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post PyBreakout Version 0.3 is out Reply with quote
Version 0.3 is OUT.

I have updated the top entry in this Topic to reflect the changes.

Triball and Slowball bonuses are awaiting within Smile

Check out the Version 0.3 of Pybreakout
Thu Oct 19, 2006 11:05 pm View user's profile Send private message Visit poster's website
chryso
Omni-usurper


Joined: 25 Sep 2006
Posts: 18
Location: Flar-eeee-da

Post Reply with quote
It is frickin' awesome when you get about 10 tri powerups. The levels just whiz by! Very Happy

I found a bug however. When you go for a tri powerup and miss your ball as a result (but get the bonus), it crashes with:
Code:
Traceback (most recent call last):
  File "pybreakout.py", line 551, in ?
    game.play()
  File "pybreakout.py", line 362, in play
    if self.balls[0].stuck:
IndexError: list index out of range


PyBreakout is looking very good, sir. I love the sound effects!

-C.
Sat Oct 21, 2006 12:53 pm View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post Reply with quote
Thanks for the bug report, I will check into it.

I am really excited about some of the people that are checking out the game. I am getting some global hits on the old website because of it. I better keep improving it before everyone's interest disappears.




Pretty sweet, huh?
Sun Oct 22, 2006 5:58 pm View user's profile Send private message Visit poster's website
neko



Joined: 03 Jul 2007
Posts: 1

Post Pause, fullscreen, and minimize Reply with quote
I made a few changes to the source code of PyBreakout that add some functionality.

The added controls are:
P - Pause/unpause the game and release the mouse cursor
F - Switch into fullscreen mode
M - Pause, minimize the game, and release the mouse cursor

You can download the modded version here.
Sat Jul 07, 2007 7:17 am View user's profile Send private message
npdawson
Site Admin


Joined: 14 Sep 2006
Posts: 32
Location: Illinois

Post Reply with quote
Hey Neko...

Thanks for checking out the game. I will take a look at your modifications.

-Nate
Sun Jul 08, 2007 9:46 am View user's profile Send private message Visit poster's website
Display posts from previous:    
Reply to topic    natedawson.com Forum Index » Python All times are GMT - 6 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL.