Hi all,
I'm trying to get my head around objective-c arrays, being an AS3 developer and only practicing with sparrow a short time.
its tripped me up, and out on more than one occasion.
I'm really just trying to convert something simple based on a isometric grid.
Any help would be most appreciated...
AS3 Code::::
public var tile_list:Array = []; //this array is to hold the tile objs
var i:Number = 24; //tiles wide
var j:Number = 24; //the number of tiles deep
var num_x:Number;//
var num_y:Number; //
for(num_x = 0; num_x <i; num_x ++)
{
tile_list[num_x] = new Array();
for(num_y = 0; num_y < j; num_y ++)
{
//create Tile object from stage object
tile_list[num_x][num_y] = new Grid_Object(); //Our grid tile in the library
tile_list[num_x][num_y].x = (num_y - num_x) * 35;
tile_list[num_x][num_y].y = (num_y + num_x) * 35 / 2);
this.addChild(tile_list[num_x][num_y]); //add to the stage
}
}