Hello,
Maybe anyone have idea how to make Isometric object’s bigger than one tile?
Something like I am have:
map = [ // Tile map
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]];
objMap = [ // Object map
[1, 0, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0]];
tileImg = 'tile.png';
objImg = 'obj.png';
tileArray = Array(tileImg, ...);
objArray = Array(objImg, ...);
tileW = 16; // Tile width
tileH = 16; // Tile height
function drawMap() {
for(i = 0; i < map.length; i++) {
for(var j = map[i].length; j++) {
drawTile = map[i][j];
drawObj = objMap[i][j];
x = (i-j) * tileH;
y = (i+j) * tileH / 2;
drawImage(tileArray[drawTile], x, y);
if(drawObj) {
drawImage(objArray[drawObj-1], x, y - 16);
}
}
}
}
Sorry for no Java code, but I am think this is easy understand.
In here can draw isometric tile map with object’s. One object only can take one tile, but how to make Object where use 4 tiles or more? Maybe can anyone share idea?
Sorry for my English language and sorry for newbie questions. Thanks!