A simple brickbreaker game written in Python, utilising OOPS concepts and is playable on the Terminal, not making use of any cursor libraries. The only libraries required are numpy
and colorama
. playsound
is used for the background sounds.
-
Bricks of various types such as normal (bricks which break after n number of hits, where n varies between {1, 2, 3} for each brick), unbreakable (bricks which can be broken only under special circumstances) and exploding bricks (bricks which explode and break all neighbouring bricks, irrespective of strength)
-
A simple paddle which is used to control the ball. The ball velocity depends on where it lands on the paddle, with most deflection observed at the edges.
-
Powerups such as:
- Fast Ball : Increases the speed of the ball
- Expand Paddle: Increases the paddle size
- Shrink Paddle: Decreases the paddle size
- Ball Multiplier: Multiplies the number of balls
- Thru Balls: Allows the ball to pass through and break any type of brick
- Paddle Grab: Allows the paddle to grab the ball and relaunch at will
- Shoot Laser: Paddle shoots lasers to break bricks
- Fire Ball: A brick explodes all neighbouring bricks
s - Release the ball from the paddle
a - Move the paddle to the left
d - Move the paddle to the right
l - Skip
Note that all these controls are case sensitive.
The game is written in a modular fashion, allowing new features to be added with minimum modification. Writing duplicate code is avoided using the principles of inheritance and polymorphism as and when needed.
- pip3 install numpy
- pip3 install colorama
- pip3 install playsound
- python3 main.py