I am creating a breakout style game and currently stuck on a particular problem for which I am sure there is a solution but have not been able to figure it out. So there are 3 walls (left, right, and top) and my problem is that when the ball bounces off the left or right wall it then goes on to hit the top wall at an angle which then causes the ball to hit the next wall (left or right) towards the bottom of the wall, this is affecting the intended gameplay I am trying to achieve for my particular version of breakout and is making the game harder to play.
What I am trying to achieve is whenever the ball hits either the left or right for it to then go onto hit the top wall around the centre and then again from the top wall to hit the left or right wall (the opposite of the first wall hit) near its centre and so on. Basically what I want is the ball to go about bouncing of the walls at a regular angle around the centre of each wall.
Desired behaviour