i started doing sifertims rpg making tutorial and im onto the bit were you make the tiles.
ive done it 3 times and all it does is when i dont put the item map it doesnt show the guy and if i put the item map it only shows the guy.
money = 0;
mvWdth = 576;
mvHght = 576;
tileWdth = 64;
tileHght = 64;
tile0 = function () {};
tile0.prototype.pos = 1;
tile0.prototype.barrier = false;
tile1 = function () {};
tile1.prototype.pos = 2;
tile1.prototype.barrier = true;
tile2 = function () {};
tile2.prototype.pos = 3;
tile2.prototype.barrier = true;
map1 = [[2,2,2,2,2,2,2,2,2],
[2,2,2,0,0,0,0,0,2],
[2,2,1,0,0,0,0,0,2],
[2,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,2],
[1,1,1,0,0,0,1,1,2],
[1,1,0,0,0,0,0,1,2],
[1,1,1,1,2,2,2,2,2]];
function MapMaker (map) {
_root.attachMovie(“blank”, “tiler”, d++);
var mapWdth = map[0].length;
var mapHght = map.length;
for (var i = 0; i < mapHght; i++) {
for (var j = 0; j < mapWdth; j++) {
var name = “tile_”+j+"_"+i;
_root[name] = new _root[“tile”+map*[j]];
_root.tiler.attachMovie(“TileSet1”, name, i100+j2);
_root.tiler[name]._x = (j*_root.tileWdth);
_root.tiler[name]._y = (i*_root.tileHght);
_root.tiler[name].gotoAndStop(_root[name].pos);
}
}
}
MapMaker(map1);
itemMap1 = [[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0]]
function placeItems (map) {
_root.attachMovie(“blank”, “items”, this.getNextHighestDepth());
var mapWdth = map[0].length;
var mapHght = map.length;
for (var i = 0; i < mapHght; i++) {
for (var j = 0; j < mapWdth; j++) {
switch (map*[j]){
case 1 :
_root.items.attachMovie(“Guy”,“guy_mc”, d++);
_root.items.guy_mc._x = (_root.tileWdth * j);
_root.items.guy_mc._y = (_root.tileHght * i);
}
}
}
}
placeItems(itemMap1);
thats the code and i cant see were im going wrong :S please help me.