Good work.
Don't be discouraged by blunt critiques of your code or pseudocode. Absolutely everyone starts off writing bad code, and hardly anyone found this particular problem easy when they first encountered it. It's not my style, but some people don't see a point in sugarcoating it with newbies, particularly if you seem resistant to taking advice.
If you're finding that previous attempts to help you are still too complicated, then try something simpler. Don't worry about Breakout, or moving balls, or making bricks disappear. Instead, just see if you can write a function that can determine whether a circle and a rectangle are overlapping. A few tips:
- The circle can be represented by a radius (float) and a center point (2D vector, or separate floats for x and y).
- The rectangle can be represented by a position (x, y) and size (width, height). Alternatively, you could have four separate floats for the positions of the left, right, top, and bottom edges of the box. Either way, you're dealing with what's called an axis-aligned box, because the box is not tilted or rotated.
- If you can determine the distance between the circle's center point and the box (see: Arvo's algorithm), then you have the problem solved. You just need to see if this distance is less than the radius of the sphere.
This won't completely solve your collision problems, but it'll be a good first step. I would advise doing this exercise, even if you already have your game collision working. It sounds like you might be doing some unnecessary stuff (like having separate steps for separate brick layers) and there's good reason to believe that you'll start running into trouble once the ball starts bouncing from other directions (e.g., if the player gets the ball in the top area). Much better to start simple with an algorithm that you understand step-by-step.