Topic: Tiled Graphic problem
A more compact way of providing graphics is to use tiles.
in it's simplest form, make a couple of tiles and call them from an array...
myMap = [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,1,1,0,0,1],
[1,0,1,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,1,0,0,0,0,0,0,0,0,1],
[1,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,1],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ];
would call out black & white 16x16 tiles given the following algo:
tileW = 16;
tileH = 16;
function buildMap (map) {
var mapWidth = map[0].length;
var mapHeight = map.length;
for (var i = 0; i<mapHeight; ++i) {
for (var j = 0; j<mapWidth; ++j) {
this.attachMovie("tile", "t_"+i+"_"+j, ++d);
this["t_"+i+"_"+j]._x = (j*tileW);
this["t_"+i+"_"+j]._y = (i*tileH);
this["t_"+i+"_"+j].gotoAndStop(map[i][j]+1);
}
}
}
buildMap (myMap);
I can get this to run using the same settings I use to test a piece of code for Chumby on my local machine (320 x 240, Flash 5 or 6)...
but I can not for the life of me get this to run on the virtual Chumby...
Is there a reason for this that I'm missing? (I'm more of a hardware guy so this is quite likely...)
Thanks!
Bruce