Skip to content

Instantly share code, notes, and snippets.

@nerik
Created July 2, 2012 16:04
Show Gist options
  • Save nerik/3033985 to your computer and use it in GitHub Desktop.
Save nerik/3033985 to your computer and use it in GitHub Desktop.
function makeTiles()
{
_tilesContainer = new Sprite();
_tiles = new Array();
var line:Array<Tile>;
var tile:Tile;
for (i in 0...Constants.GRID_H)
{
line = new Array();
for (j in 0...Constants.GRID_W)
{
tile = new Tile(j,i);
tile.x = j * Constants.CELL_W;
tile.y = i * Constants.CELL_W;
_tilesContainer.addChild(tile);
line.push(tile);
}
_tiles.push(line);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment