I initialized the first bricks position, then made two for
loops inside of which I created a GRect
object, set its color and added it to the window and also adjusted the brick's location for each row and column but no bricks appear at all.
I tried using drawRect()
but still no bricks appeared.
I don't know what the problem is; why aren't any bricks added although the ball and the paddle are just fine?
double x = 0, y = 0;
for (int i = 0; i > ROWS; i++)
{
for (int j = 0; j > COLS; j++)
{
GRect brick = newGRect(x, y, B_WIDTH, B_HEIGHT);
setColor(brick, "RED");
setFilled(brick, true);
add(window, brick);
x = x + B_WIDTH + 10;
}
y = y + B_HEIGHT + 7;
}