function renderTileMap() {
  //TODO make cols get a sorted map.tiles where the longest one is first. That way if the map has a none-square shape it will still render the by the longest X width
  cols = map.tiles[0].length
  rows = map.tiles.length
  canvas.width = cols * tileSize;
  canvas.height = rows * tileSize;

  for (i = 0; i < map.tiles.length; i++) {
    for (index = 0; index < map.tiles[i].length; index++) {

      context.fillStyle = map.tiles[i][index].tileData.color
      context.fillRect(
        index * tileSize,
        i * tileSize,
        tileSize,
        tileSize
      )
    }
  }

  
}
//Renders the Canvas with the colors data of each tile
Renders the Canvas with the colors data of each tile
Renders the Canvas with the colors data of each tile
function renderTileMap() {
  cols = map.tiles[0].length
  rows = map.tiles.length
  canvas.width = cols * tileSize;
  canvas.height = rows * tileSize;
  for (i = 0; i < map.tiles.length; i++) {
    for (index = 0; index < map.tiles[i].length; index++) {
      context.fillStyle = map.tiles[i][index].tileData.color
      context.fillRect(
        index * tileSize,
        i * tileSize,
        tileSize,
        tileSize
      )
    }
  }
}
function renderTileMap ( ) { cols = map . tiles [ 0 ] . length rows = map . tiles . length canvas . width = cols * tileSize ; canvas . height = rows * tileSize ; for ( i = 0 ; i < map . tiles . length ; i ++ ) { for ( index = 0 ; index < map . tiles [ i ] . length ; index ++ ) { context . fillStyle = map . tiles [ i ] [ index ] . tileData . color context . fillRect ( index * tileSize , i * tileSize , tileSize , tileSize ) } } }
Renders the Canvas with the colors data of each tile
Renders the Canvas with the colors data of each tile
//TODO make cols get a sorted map.tiles where the longest one is first. That way if the map has a none-square shape it will still render the by the longest X width