All pastes #774704 Raw Edit

Untitled

public text v1 · immutable
·published 2007-11-15 11:25 UTC
rendered paste body
selectedTile = 0;
mapString = String;
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 = [[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, 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 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[i][j]]();
			_root.tiler.attachMovie("TileSet1", name, i*100+j*2);
			_root.tiler[name]._x = (j*_root.tileWdth);
			_root.tiler[name]._y = (i*_root.tileHght);
			_root.tiler[name].gotoAndStop(_root[name].pos);
		}
	}
}
MapMaker(map1);