ok, so heres my issue. I am trying to make the level the way I want it. I have been wrecking my brain literally for months figuring out arrays and all that and the as3isolib as well. I have done the tutorials and obviously i have picked up on some things and I understand the for loops and stuff somewhat but for some reason I am having a hard time with it actually working and I know its something I am doing for sure. Problem is I dont know what it is. I have a feeling its getting the map array to function with the isoSprites the right way but I dont know how to do that.
package
{
import as3isolib.display.IsoSprite;
import as3isolib.display.IsoView;
import as3isolib.display.scene.IsoGrid;
import as3isolib.display.scene.IsoScene;
import as3isolib.geom.Pt;
import flash.display.Sprite;
[SWF(width="800", height="600", backgroundColor="#000000", frameRate="30")]
public class game extends Sprite
{
private static const CELL_SIZE:Number= 50;
private var grid:IsoGrid;
private var scene:IsoScene;
private var view:IsoView;
public function game()
{
grid = new IsoGrid();
grid.setGridSize(8,8,1);
grid.showOrigin = false;
grid.cellSize = CELL_SIZE;
scene = new IsoScene();
scene.addChild(grid);
var myMap:Array = [
[1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,1,1,],
[1,0,0,0,0,0,1,0,],
[1,0,0,1,0,0,1,0,],
[1,0,0,1,1,1,1,0,],
[1,0,0,0,0,0,0,0,],
[1,1,1,1,1,1,1,1,]
];
var iso:IsoSprite
for(var i:int=0; i<8; i++)
{
for(var j:int=0; j<8; j++)
{
iso = new IsoSprite();
iso.moveBy(j*50, i*50, 0);
iso.sprites[brick,grass];
}
}
scene.render();
view = new IsoView();
view.setSize(800,600);
view.centerOnPt(new Pt(200,200,0));
view.addScene(myMap[j][i]);
addChild(view);
}
}
}