Hi everybody
I have a little problem with my isometric tile chat beceause i cant get object that are bigger than one tile on mij stage beceause the depths dont seem right then.
This is wat i have at the moment:
But as you can see the building intersects with the wall.
I heared this could be fixed with masks or a second map array
But i dont know how to do this.
Here is my code for making the map:
myMap1 = [[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]];
game = {tileW:20,tileH:20}
game.Tile0 = function(){};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile1 = function(){};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function(){};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 5;
char = {xtile:2, ytile:2, speed:5, moving:false, height:10, width:10};
function buildMap(map,username,geslacht,admin){
_root.attachMovie("mouse","mouse",2);
_root.attachMovie("empty","tiles", 1);
_root.tiles.attachMovie("empty","back",0);
game.clip = _root.tiles;
game.clip._x = 268;
game.clip._y = 235;
var mapWidth = map[0].length;
var mapHeight = map.length;
for(i = 0; i < mapHeight; ++i){
for(j = 0; j < mapWidth; ++j){
var name = "t_"+i+"_"+j;
game[name] = new game["Tile"+map*[j]]();
if(game[name].walkable){
var clip = game.clip.back;
}else{
var clip = game.clip;
}
game[name].depth = (i+j)*game.tileW/2*300+(j-i)*game.tileW+1;
clip.attachMovie("tile",name,game[name].depth);
clip[name]._x = (j-i)*game.tileW;
clip[name]._y = (j+i)*game.tileW/2;
clip[name].gotoAndStop(game[name].frame);
}
}
var ob = char;
ob.x = ob.xtile*game.tileW;
ob.y = ob.ytile*game.tileW;
ob.xiso = ob.x - ob.y;
ob.yiso = (ob.x+ob.y)/2;
ob.depthshift = (game.tileW-ob.height)/2;
ob.depth = (ob.yiso-ob.depthshift)*300+ob.xiso+1;
game.clip.attachMovie("char","char", ob.depth);
ob.clip = game.clip.char;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.clip.gotoAndStop(ob.frame);
ob.clip.mouse_over.name_txt.name.text = username;
/////////// =======> connecten met chat <======= /////////////
startChat(username,geslacht,admin,ob.xiso,ob.yiso);
}
I hope someone can halp me with this problem.
Sorry for my bad englisch