Example #1
0
 //Constructor
 public Level(Texture2D dirt, bool[,] vals)
 {
     height = vals.GetLength(0);
     length = vals.GetLength(1);
     tL = new Tile[height, length];
     for (int i = 0; i<height; i++){
         for (int j = 0; j<length; j++){
             tL[i,j]= new Tile(new Rectangle(80*j, 80*i, 80, 80), dirt, vals[i,j]);
         }
     }
 }
Example #2
0
 //advanced constructor
 public Level(Texture2D dirt, Int16[,] vals)
 {
     height = vals.GetLength(0);
     length = vals.GetLength(1);
     tL = new Tile[height, length];
     for (int i = 0; i < height; i++)
     {
         for (int j = 0; j < length; j++)
         {
             tL[i, j] = new Tile(new Rectangle(tileSide * j, tileSide * i, tileSide, tileSide), dirt, vals[i, j]);
         }
     }
 }