Exemplo n.º 1
0
Arquivo: Board.cs Projeto: kazha/Pearl
 public Board(SpriteBatch spritebatch, Texture2D tileTexture, int columns, int rows)
 {
     Columns = columns;
     Rows = rows;
     TileTexture = tileTexture;
     SpriteBatch = spritebatch;
     Tiles = new Tile[Columns, Rows];
     InitializeAllTilesAndBlockSomeRandomly();
     SetAllBorderTilesBlocked();
 }
Exemplo n.º 2
0
Arquivo: Board.cs Projeto: kazha/Pearl
 private void InitializeAllTilesAndBlockSomeRandomly()
 {
     for (int x = 0; x < Columns; x++)
     {
         for (int y = 0; y < Rows; y++)
         {
             Vector2 tilePosition = new Vector2(x * TileTexture.Width, y * TileTexture.Height);
             Tiles[x, y] = new Tile(TileTexture, tilePosition, SpriteBatch, _rnd.Next(5) == 0);
         }
     }
 }