This is the Breakout Game. Make sure you control the ball with your paddle and destroy the wall of bricks! Don’t let the ball hit the ground otherwise you will lose a life!

OOP Breakout Game

How this game works!

  • The game loop: The whole game is a continuous loop that constantly updates object positions and redraws the screen
  • The object-oriented code: Every major item like the ball and brick is a separate class in the code, keeping their unique behaviors separate and organized and easy to find! (like movement or score points)
  • Movement: The ball updates its position based on its speed, while the paddle moves based on input such as the arrow keys we press
  • Collisions & Bouncing: A core function checks for when the ball and brick overlap or touch, and that makes the ball's direction reverse
  • Bricks & Score: Hitting a Brick changes its status to "destroyed," and adds points to the score