Ok i managed to implement wall autotiling even if the implementation its a bit dirty still. I found this article about autotiling and walls: http://pixel.oceansdream.net/?cat=4 and i wrote this routine in as3: ``` public function DrawWall(layer, x, y, origin:Point=null, rect:Rectangle=null, color:uint=0xFFFFFF) { var dy=64; origin=new Point(origin.x,-dy+origin.y); var rect=new Rectangle(map.tiles[layer][x][y].bmpRect.x+rect.x, map.tiles[layer][x][y].bmpRect.y+rect.y, rect.width, rect.height); map.bmpData.copyPixels(map.tiles[layer][x][y].tileset.bmpData, rect, origin); origin=new Point(x*32,32-dy+y*32); var rect1=new Rectangle(map.tiles[layer][x][y].bmpRect.x+0, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); var rect2=new Rectangle(map.tiles[layer][x][y].bmpRect.x+0, map.tiles[layer][x][y].bmpRect.y+96, 0, 0); if (TileExists(layer,x,y,Direction.Right)) { rect2=new Rectangle(map.tiles[layer][x][y].bmpRect.x+16, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); } if (TileExists(layer,x,y,Direction.Left)) { rect1=new Rectangle(map.tiles[layer][x][y].bmpRect.x+32, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); rect2=new Rectangle(map.tiles[layer][x][y].bmpRect.x+48, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); } if (!TileExists(layer,x,y,Direction.Left) && !TileExists(layer,x,y,Direction.Right)) { rect2=new Rectangle(map.tiles[layer][x][y].bmpRect.x+48, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); } if (TileExists(layer,x,y,Direction.Left) && TileExists(layer,x,y,Direction.Right)) { rect1=new Rectangle(map.tiles[layer][x][y].bmpRect.x+16, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); rect2=new Rectangle(map.tiles[layer][x][y].bmpRect.x+32, map.tiles[layer][x][y].bmpRect.y+96, 16, dy/2); } map.bmpData.copyPixels(map.tiles[layer][x][y].tileset.bmpData, rect1, origin); map.bmpData.copyPixels(map.tiles[layer][x][y].tileset.bmpData, rect2, new Point(origin.x+16,origin.y)); var rect3=new Rectangle(rect1.x,rect1.y+dy-dy/2,rect1.width,rect1.height); map.bmpData.copyPixels(map.tiles[layer][x][y].tileset.bmpData, rect3, new Point(origin.x,origin.y+dy/2)); var rect4=new Rectangle(rect2.x,rect2.y+dy-dy/2,rect2.width,rect2.height); map.bmpData.copyPixels(map.tiles[layer][x][y].tileset.bmpData, rect4, new Point(origin.x+16,origin.y+dy/2)); } ``` So this function is used instead of Draw function if the tile is a wall. The 'dy' var defines the 'height' of the wall, so you can have walls of 1(32) or 2(64) tiles of height. and the function autotiles the wall roof as normal autotiling (as implemented by MrMiguu) and then autotiles the wall surface too. I'll try to upload the as3 movie somewhere soon if anybody is interested. Cheers!