Exemple #1
0
    void RotateTetramino(bool isClockwise)
    {
        if (isFirstRotation)
        {
            horizontalAddition += initialTetraminoYAddition;
            isFirstRotation     = false;
        }

        if (isClockwise)
        {
            currTetramino.incrementState();
        }
        else
        {
            currTetramino.decrementState();
        }

        if (isPositionAvailable(currTetramino.States [currTetramino.CurrentState]))
        {
            System.Array.Copy(currTetramino.States [currTetramino.CurrentState], currTetraminoCoords, 8);
        }
        else
        {
            if (isClockwise)
            {
                currTetramino.decrementState();
            }
            else
            {
                currTetramino.incrementState();
            }
        }
        UpateCurrentCubesPosition();
    }