Im trying to make a game but i need some help with items. I cant get two items show up on the map,only one appears. If someone can help me fixing my code ill aprecciate:
function placeItems (map) {
_root.attachMovie(“empty”, “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);
case 2:
_root.items.attachMovie("Cash","cash_mc", d++);
_root.items.cash_mc._x = (_root.tileWdth * j);
_root.items.cash_mc._y = (_root.tileHght * i);
}
}
}
}
placeItems(itemMap1);