Skip to content

Zarathecat/breakout-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Copyright 2016 Zara Zaimeche

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


This... is a breakout clone. I made it to see if I could without using tutorials.
It took about an hour and a half for the main thing (the breakout-clone.py).
I then spent much longer in inkscape making some pretty bricks, and improved the
game flow so it had text on the screen and things. And a weekend making music
since this was just an excuse for that.

To play, you will need python and pygame installed. Be warned that
`pip install pygame` will not install all pygame's dependencies;
you should use `apt-get install python-pygame`.

If you'd like to have music in the game, create a 'music' directory at the top
level of the repo. There are some generic tracks that I made for it on my
website, at: https://zarathecat.github.io/music.html . If you'd like to
have *good* music in the game, move your own tracks to the 'music' directory
and name them 'breakout-1.mp3', and so-on. You will need 7 tracks;
the code is currently lazy; the game will break if there is a 'music'
directory present but the track for the relevant level is missing. Well, it
used to break if there was no music, so that's progress, at least.


TODO:

* Improve physics. The angle at which the ball hits the paddle should be able to change.

  I may just leave this project as-is and do it on the next, since this was
  just a disposable 'what can I do and how quickly can I do it?' thing.

  (Ball movements are currently not
  that finegrained, since the x is either -ballspeed or + ballspeed, and ditto
  for y. so that means that it's currently always bouncing off at a 90 degree
  angle. so to begin with, ballspeedx needs to be decoupled from ballspeedy.
  then, they need to be calculated relative to their previous value, which
  should map to the angle.)

* Maybe make pretty backgrounds. This is tough as a) I don't know how and
  b) They need to be visually distinct from the bricks. Other games use
  photography for this. I'm rubbish at photography and would rather not
  use my holiday snaps.

About

Generic breakout clone, using python and pygame

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages