Level level = game.level;
int size = 100;
for (int xBlock = -size; xBlock <= size; xBlock++) {
for (int zBlock = -size; zBlock <= size; zBlock++) {
Block block = level.create(xBlock, zBlock);
Block east = level.create(xBlock + 1, zBlock);
Block south = level.create(xBlock, zBlock + 1);
if (block.solid) {
if (!east.solid) {
renderWall(xBlock + 1, xBlock + 1, zBlock, zBlock + 1, 0);
renderWall(xBlock + 1, xBlock + 1, zBlock, zBlock + 1, 1);
}
if (!south.solid) {
renderWall(xBlock + 1, xBlock, zBlock + 1, zBlock + 1, 0);
renderWall(xBlock + 1, xBlock, zBlock + 1, zBlock + 1, 1);
}
} else {
if (east.solid) {
renderWall(xBlock + 1, xBlock + 1, zBlock + 1, zBlock, 0);
renderWall(xBlock + 1, xBlock + 1, zBlock + 1, zBlock, 1);
}
if (south.solid) {
renderWall(xBlock, xBlock + 1, zBlock + 1, zBlock + 1, 0);
renderWall(xBlock, xBlock + 1, zBlock + 1, zBlock + 1, 1);
}
}
}
}
for (int xBlock = -size; xBlock <= size; xBlock++) {
for (int zBlock = -size; zBlock <= size; zBlock++) {
Block block = level.create(xBlock, zBlock);
for (int s = 0; s < block.sprites.size(); s++) {
Sprite sprite = block.sprites.get(s);
renderSprite(xBlock + sprite.x, sprite.y, zBlock + sprite.z);
}
}