public Tetromino(int gridWidth, TetrisBoard board)
    {
        int i = Random.Range(0, 7);

        switch (i)
        {
        case 0:
            type = S_LEFT;
            break;

        case 1:
            type = S_RIGHT;
            break;

        case 2:
            type = L_LEFT;
            break;

        case 3:
            type = L_RIGHT;
            break;

        case 4:
            type = CROSS;
            break;

        case 5:
            type = STRAIGHT;
            break;

        default:
            type = SQUARE;
            break;
        }

        rotation       = Random.Range(0, 4);
        column         = 3;
        this.gridWidth = gridWidth;
        this.board     = board;

        ResolvePosition();
    }
Beispiel #2
0
 // Constructor
 public RFTets(RFTets src)
 {
     lattice = src.lattice;
     density = src.density;
     noise   = src.noise;
 }
Beispiel #3
0
 // Constructor
 public RFTets()
 {
     lattice = TetType.Uniform;
     density = 7;
     noise   = 100;
 }