The player will be using a paddle with a bouncing ball to smash a wall of bricks and make high scores! The objective of the game is to break all the bricks as fast as possible and beat the highest score! You lose a life and all the power ups gained when the ball touches the ground below the paddle.
Ensure that you have python3.6+ and pip installed.
pip3 install -r requirements.txt
Run the following to play the game
python3 main.py
- A: To move the paddle left
- D: To move the paddle right
- SPACE: To release the ball from the paddle
- L: To skip a level
- H: To reduce boss health
- Q: To quit game
*Note: The controls are force-based. No need to press them continuously to achieve motion.
Collect power ups, and destroy bricks to increase your score. But beware of some power up as they might increase the ball speed or shrink your paddle!
Press A and D for movement and try to save the ball from falling into the abyss. Also press space to release a new ball or when sticky paddle
power up is active at whichever position you like.
Score the highest points by breaking all the bricks (even the unbreakable ones!)
Here's a list of instances of the OOPS concepts in use:
The ball
, brick
, paddle
, GenericPowerUp
, Boss
, Bomb
, classes inherit from generic
class.
The activate_power_up()
method defined in GenericPowerUp
class has been overridden in the different classes ExpandPaddle
, ShrinkPaddle
, SpeedUpBall
, StickyPaddle
, ThroughBall
, BallMultiplier
, ShootingPaddle
. This example of method overriding represents polymorphism.
The entire game is modelled using classes and objects which encapsulate logically different entities.
Methods like activate_power_up()
, _initialize_bricks
, _draw
, _terminate
, _handle_input
, _detect_brick_ball_collision
abstract away the details and make the code more readable and organised.