• entries
    33
  • comments
    37
  • views
    38435

[Development] I've made Pong and Breakout in Pygame!

Sign in to follow this  
superman3275

1274 views

Well, I did it. Pong and Breakout in pygame!

I'm not putting Pong up, it was hacked together and I'm not very proud of it.

I am, however, putting up Breakout! I coded a finite-state-machine, a basic button GUI system, all of my states, the paddle, the ball, the bricks, all object-oriented with beautiful pygame! And everything is completely commented, with classes having long documentation strings. It comes in at a little over four-hundred lines, and the executable is here:

BREAKOUT smile.png!

And the source (along with the executable file and setup.py):

BREAKOUT SOURCE smile.png!

I am very proud of this code. It looks (and feels) beautiful, and I can't wait to work on some more games (I see space invaders in the future!).

I'm going to eventually write a source analysis and talk about it more, however it's pretty late and I should probably get to bed.

See you guys tomorrow smile.png!

And I'm back! That was some good sleep!

So, I made a video of the game!

And I'm really happy with how it turned out! I'm working on adding more levels as we speak smile.png!

A Few Hours Later - And I'm back!

I'm actually uploading the files in the morning, however there is now:

FOUR AWESOME LEVELS!
SOME BRICKS TAKE TWO HITS, AND IF THEY ARE HIT A DIFFERENT TEXTURE (BROKEN BLOCK) IS DISPLAYED!
MAPS ARE AWESOMELY GENERATED USING EITHER A LIST COMPREHENSIONS OR TRADITIONAL FOR LOOPS!
COLORS ARE RANDOM!
THERE IS A RANDOM MAP, A PYRAMID MAP, AND A RAINBOW MAP!
THERE IS A MAIN MENU!
THERE IS A GAME OVER SCREEN!
ONCE YOU COMPLETE A LEVEL YOU ADVANCE TO THE NEXT LEVEL. IF THE BALL GOES OFF THE SCREEN YOU GO TO THE GAME-OVER SCREEN!

I believe it is finished! Have fun :)!

NEXT PROJECT: SPACE INVADERS, SUPERMAN3275 STYLE!
Sign in to follow this  


6 Comments


Recommended Comments

Tried exe, seems nice :) Just two question

 

1) Why does ball sometimes penetrate through few bricks instead of bouncing away when hit? For example, ball managed to get to the bricks in the 2nd row from top despite bricks from 3rd and 4th row being in the way.

 

2) This is minor, but... when the brick is destroyed, why are surrounding bricks changing color? XD

 

Anyway, congratulations for completing it.

Share this comment


Link to comment

Tried exe, seems nice smile.png Just two question

 

1) Why does ball sometimes penetrate through few bricks instead of bouncing away when hit? For example, ball managed to get to the bricks in the 2nd row from top despite bricks from 3rd and 4th row being in the way.

 

2) This is minor, but... when the brick is destroyed, why are surrounding bricks changing color? XD

 

Anyway, congratulations for completing it.

1) Well, my collision isn't the best...

 

2) That has never happened for me. I think that it just looks like they change color.

 

Thanks :)!

Share this comment


Link to comment

Superman,

 

On your video the game seems fast, but when I run it last time the ball was moving x3-4 slower, so it was a bit of boring, not sure if this is a bug or you've made enhancements.

Share this comment


Link to comment

Superman,

 

On your video the game seems fast, but when I run it last time the ball was moving x3-4 slower, so it was a bit of boring, not sure if this is a bug or you've made enhancements.

You just need to run it again. The ball's speed is randomized somewhat, and I can't completely make it random and make it never be slow, so just running the game again will give you a new (hopefully faster) ball speed.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now