Yes! I did it. I created the Brick class, declared a Brick in the loop, saved the Brick created in a list, with its properties (position, brick number and if its visible or not)
Then, I created a foreach loop, and all 15 bricks were drawn. The spritebatch code is protected by an if, which checks if the brick's visible property is true, and if it false then it skips the code so it doesnt draw the brick.
All this I was able to do with your help, so I appreciate it very much!
BUT
I still have to code the collision between the ball and the brick... so far the ball collides with the screen edges and the pad. I will try to create a collision method that when the ball collides with a brick, its visible property is change to false, si it isn't drawn anymore. The good thing about the objects is that now I don't have to create a method that makes the Brick dissapear, but just change its visible property to false. Any ideas?
The collision between the Pad and the ball:
It is in spanish so:
Pelota = Ball
Lugar = Place
Paleta = Pad
Forma = Shape = the texture itself
float
x1 = pelotalugar.X;
float y1 = pelotalugar.Y;
float h1 = pelotaforma.Height;
float w1 = pelotaforma.Width;
float x2 = paletalugar.X;
float y2 = paletalugar.Y;
float h2 = paletaforma.Height;
float w2 = paletaforma.Width;
if (((x2 > x1 && x2 < x1 + w1) || (x1 > x2 && x1 < x2 + w2)) && ((y2 > y1 && y2 < y1 + h1) || (y1 > y2 && y1 < y2 + h2))) //omg iz complicated
{
pelotavelocidad.Y *= -1; // changes the ball's course
}