i am trying to create breakout. code below loop though my 2d array(map) and creates bricks. the problem is that i want to add 10 pixels space between each bricks. i was thinking to add x*titleWidth+x+10 in side blockobject but it moves all of the bricks and there is no space in between. any ideas?
for (int y = 0; y < map01.length; y++){ //row
for (int x = 0; x < map01[y].length; x++){ // cols
if(map01[y][x] == 2){ //Bricks
blockObject = new Block(x*tileWidth+x, y*tileHeight+y, tileWidth, tileHeight);
}
}
}