This code works but I'm not really sure if I wrote it good enough. It seems a bit vague but I can't really assess it properly. I'm particularly concerned with the xAxis
variable. I don't like how I have to initialize it inside the first loop. I would rather have it next to yAxis
. Is this a problem?
float yAxis = SPACE_BETWEEN_TILES;
float xAxis;
for(int i = 0; i < 3; i++) {
xAxis = SPACE_BETWEEN_TILES;
for(int v = 0; v < 3; v++) {
shapeRenderer.rect(xAxis, yAxis, 10, 10);
xAxis = TILE_WIDTH_AND_HEIGHT + xAxis;
}
yAxis = yAxis + TILE_WIDTH_AND_HEIGHT;
}