Good god, who knew Tetris was so complicated? I’m a self-taught intermediate/advanced Unity developer (going by the classifications on Unity’s tutorials) so I usually know my way around developing a lot of games, but this…!
Can anybody help me rotate a Tetramino as represented by a 2D array? Examples of the arrays follow:
int[][] tetraminoT =
{
new int[] {0,0,0,},
new int[] {1,1,1,},
new int[] {0,1,0,}
};
int[][] tetraminoJ =
{
new int[] {0,1,0,},
new int[] {0,1,0,},
new int[] {1,1,0,}
};
int[][] tetraminoI =
{
new int[] {0,1,0,0 },
new int[] {0,1,0,0 },
new int[] {0,1,0,0 },
new int[] {0,1,0,0 }
};
Using a gameObject as a pivot and calling Transform.Rotate or Rigidbody.MoveRotation are insufficient to answer this question. I’d rather solve this in game space and get some more practice with array nonsense.
Setting up the board, the tetraminos, moving them, checking for completed rows - none of this is a problem, and I expect to be able to implement SRS & wall kick stuff when I get over this roadblock.
A lot of people seem to think that this page holds the answer, but I’m having serious trouble parsing it.
Can anybody help a fellow traveller out? Thanks in advance. =) --Rev