I'd like to ask for some assistance converting my 2d map imported from a text file into an isometric map format. I have browsed quite a bit, still kind of new to java and i am more of a "look at example code" rather than wriiting myself. ANYTHING would be helpful at this point. I have also looked here >> How can i convert x-y position to tile x-y for isometric tile? << and here >> Drawing Isometric game worlds << i feel like im almost there but i just quite figure it out. Thank you.
for(int row = rowOffset; row < rowOffset + numRowsToDraw; row++) {
if(row >= numRows) break;
for(int col = colOffset; col < colOffset + numColsToDraw; col++) {
if(col >= numCols) break;
if(map[row][col] == 0) continue;
int rc = map[row][col];
int r = rc / numTilesAcross;
int c = rc % numTilesAcross;
x = (col / Tile_H) + (row / Tile_W);
y = (row / Tile_W) - (col / Tile_H);
g.drawImage(
tiles[r][c].getImage(),
//(((y / Tile_HH) - (x / Tile_HW)) / 2) + col * tileSize,
//(((y / Tile_HH) + (x / Tile_HW)) / 2) + row * tileSize,
//x,
//y,
x + col * tileSize,
y + row * tileSize,
null
);
}
}