예제 #1
0
 public void SetNull(Tetromino_2 tet)
 {
     foreach (Transform mino in tet.transform)
     {
         Vector2 pos = GridPosition(mino.position);
         grid[(int)pos.x, (int)pos.y] = null;
     }
 }
예제 #2
0
 private void AddBlocks(List <Tetromino_2> T, Tetromino_2 a1,
                        Tetromino_2 a2, Tetromino_2 a3, Tetromino_2 a4,
                        Tetromino_2 a5, Tetromino_2 a6, Tetromino_2 a7)
 {
     T.Add(a1);
     T.Add(a2);
     T.Add(a3);
     T.Add(a4);
     T.Add(a5);
     T.Add(a6);
     T.Add(a7);
 }
예제 #3
0
        public void UpdateGrid(Tetromino_2 t)
        {
            for (int y = 0; y < 25; y++)
            {
                for (int x = 0; x < 10; x++)
                {
                    if (grid[x, y] != null)
                    {
                        if (grid[x, y].parent == t.transform)
                        {
                            grid[x, y] = null;
                        }
                    }
                }
            }

            foreach (Transform mino in t.transform)
            {
                Vector2 pos = GridPosition(mino.position);
                grid[(int)pos.x, (int)pos.y] = mino;
            }
        }
예제 #4
0
 public void SetHold(Tetromino_2 tet)
 {
     hold = true;
     t    = tet;
 }