I'm trying to get 10 bricks in the columns and 4 rows of bricks, however all the bricks are on the same line. Can someone please help? if you need more info let me know. Thanks
void initBricks(GWindow window) { // TODO int brickXLocation = 0; int brickYLocation = 0;
// Adds a new row
for(int i = 0; i < ROWS; i++)
{
// adds bricks horizontally
for(int j = 0; j < COLS; j++)
{
GRect brick = newGRect( brickXLocation + 2, brickYLocation, BRICK_WIDTH, BRICK_HEIGHT);
setFilled(brick, true);
setColor(brick, "BLUE");
add(window, brick);
brickXLocation = (brickXLocation + 4) + BRICK_WIDTH;
}
brickYLocation = (brickYLocation + 4) + BRICK_HEIGHT;
}