Example #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (MattrisGame game = new MattrisGame())
     {
         game.Run();
     }
 }
Example #2
0
        public Board(Vector2 position, int blockSize, Texture2D squares, MattrisGame game)
        {
            BlockGrid      = new Block[UNITS_W, UNITS_H];
            squareTextures = squares;
            slamming       = false;
            Position       = position;
            numClears++;
            Level     = 1;
            Score     = 0;
            this.game = game;

            for (int a = 0; a < UNITS_W; a++)
            {
                for (int b = 0; b < UNITS_H; b++)
                {
                    BlockGrid[a, b]           = new Block();
                    BlockGrid[a, b].Width     = blockSize;
                    BlockGrid[a, b].Height    = blockSize;
                    BlockGrid[a, b].Type      = BlockTypes.Empty;
                    BlockGrid[a, b].Rectangle = new Rectangle((int)(a * blockSize + Position.X),
                                                              (int)(b * blockSize + Position.Y), blockSize, blockSize);
                    BlockGrid[a, b].Position       = new Vector2(a * blockSize + Position.X, b * blockSize + Position.Y);
                    BlockGrid[a, b].SquareTextures = squares;
                }
            }
        }