Example #1
0
 public void DrawGameBoard(int grid, ref BoardControler boardControl, ref Rectangle positionAndSize, int positionAdder, ref Board gameBoard)
 {
     for (int i = 0; i < grid; ++i)
     {
         for (int j = 0; j < grid; ++j)
         {
             String texture = viewLogic.DrawBoard(ref boardControl, i, j, ref positionAndSize, positionAdder, ref gameBoard);
             tileTexture = Content.Load <Texture2D>(texture);
             spriteBatch.Draw(tileTexture, positionAndSize, Color.White);
         }
     }
 }
Example #2
0
        public String DrawBoard(ref BoardControler boardControl, int i, int j, ref Rectangle positionAndSize, int positionAdder, ref Board gameBoard)
        {
            Tile currentTile;

            currentTile       = gameBoard.getTileAt(i, j);
            positionAndSize.X = (i + positionAdder) * tileSize;
            positionAndSize.Y = j * tileSize;
            if (boardControl.DefaultChecker(currentTile.envType))
            {
                return("T1");
            }
            else
            {
                return(currentTile.tileName);
            }
        }
Example #3
0
        public void setTileAt(int row, int col, Tile currentTile)
        {
            int tileSize = new BoardControler().tileSize;

            if (currentTile.tileName != "Blank")
            {
                currentTile.positionAndSize = new Rectangle(row * tileSize, col * tileSize, tileSize, tileSize);
                Gameboard[row, col]         = currentTile;
                try
                {
                    FillTile(row, col);
                }
                catch (Exception e)
                {
                    System.Console.WriteLine(e.Message);
                }
            }
        }
Example #4
0
        protected override void LoadContent()
        {
            spriteBatch                 = new SpriteBatch(GraphicsDevice);
            textWriter                  = Content.Load <SpriteFont>("TextWriter");
            gameBoard1                  = new Board();
            gameBoard2                  = new Board();
            boardControl                = new BoardControler();
            gameDeck                    = new Deck(deckSize);
            tileSize                    = boardControl.tileSize;
            grid                        = boardControl.grid;
            positionAndSize             = new Rectangle(0, 0, tileSize, tileSize);
            positionAndSizeOfPLacement  = new Rectangle(playerX, playerY, tileSize, tileSize);
            positionAndSizeOfPLacement2 = new Rectangle(playerX + 1, playerY, tileSize, tileSize);
            movement                    = new MovementLogic();
            roundLogic                  = new RoundLogic(ref players, 2);
            viewLogic                   = new ViewLogic(tileSize, ref gameDeck, ref positionAndSize);

            // TODO: use this.Content to load your game content here
        }