예제 #1
0
    void Start()
    {
        myGrid = new TetrisGameGrid(gridWidth, gridHeight);

        myGrid.gridSpaces[0, 0] = new Block(0, 0, BlockColor.Green);
        myGrid.gridSpaces[5, 2] = new Block(5, 2, BlockColor.Red);
        myGrid.gridSpaces[1, 0] = new Block(1, 0, BlockColor.Blue);
        myGrid.gridSpaces[0, 1] = new Block(0, 1, BlockColor.Yellow);
        myGrid.gridSpaces[1, 1] = new Block(1, 1, BlockColor.Indigo);
        myGrid.gridSpaces[1, 2] = new Block(1, 2, BlockColor.Orange);
        myGrid.gridSpaces[2, 2] = new Block(2, 2, BlockColor.White);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        myGrid = new TetrisGameGrid(gridWidth, gridHeight);

        myGrid.gridSpaces[0, 0] = new Block(0, 0, BlockColor.Green);

        /*myGrid.gridSpaces[0, 1] = new Block(0, 1, BlockColor.Blue);
         * myGrid.gridSpaces[0, 2] = new Block(0, 2, BlockColor.Red);
         *
         * for (int x = 0; x < gridWidth; x++)
         * {
         *  for (int y = 0; y < gridHeight; y++)
         *  {
         *     myGrid.gridSpaces[x, y] = new Block(x,y,BlockColor.Blue);
         *     //GameObject newGreenBlock = GameObject.Instantiate(greenBlock);
         *  }
         * }*/
    }
예제 #3
0
    private TetrisGameGrid myGrid;  //null by default


    // Use this for initialization
    void Start()
    {
        gridTotal   = gridHeight + gridExtra;
        myGrid      = new TetrisGameGrid(gridWidth, gridTotal);
        gridObjects = new GameObject[gridWidth, gridTotal];

        for (int i = 0; i < gridWidth; i++)
        {
            for (int j = 0; j < gridTotal; j++)
            {
                string useString = "/Grid/row " + j + "/Quad " + i;
                gridObjects[i, j] = GameObject.Find(useString);
            }
        }

        myGrid.gridSpaces[0, 1] = new Block(0, 1, BlockColor.Green);
        myGrid.gridSpaces[0, 0] = new Block(0, 0, BlockColor.Red);
        myGrid.gridSpaces[0, 2] = new Block(0, 2, BlockColor.Blue);
        myGrid.gridSpaces[0, 3] = new Block(0, 3, BlockColor.Gray);
        myGrid.gridSpaces[0, 4] = new Block(0, 4, BlockColor.Yellow);
        myGrid.gridSpaces[0, 5] = new Block(0, 5, BlockColor.White);
        myGrid.gridSpaces[0, 6] = new Block(0, 6, BlockColor.Cyan);
    }
    // Use this for initialization
    void Start()
    {
        myGrid = new TetrisGameGrid(gridWidth, gridHeight);

        myGrid.gridSpaces[0, 0] = new Block(0, 0, BlockColor.Green);
    }
예제 #5
0
 // Use this for initialization
 void Start()
 {
     myGrid = new TetrisGameGrid(gridHeight, gridWidth);
 }