Beispiel #1
0
    void MoveBack(int situation, bool isDown)
    {
        switch (situation)
        {
        case 0:
            break;

        case 1:
            teris1.MoveBack();
            teris2.MoveBack();
            if (isDown)
            {
                AddToGrid(teris1, teris2);
            }
            break;

        case 2:
            teris2.MoveBack();
            teris2.CheckClash(teris1);
            if (isDown)
            {
                AddToGrid(teris2);
            }
            break;

        case 3:
            teris1.MoveBack();
            teris1.CheckClash(teris2);
            if (isDown)
            {
                AddToGrid(teris1);
            }
            break;
        }
    }
Beispiel #2
0
 public void CheckClash(TerisBlock another)
 {
     foreach (Vector3 pos in currentPoints)
     {
         if (another.currentPoints.Contains(pos))
         {
             another.MoveBack();
             break;
         }
     }
 }
    void MoveBack(int situation, bool isDown)
    {
        switch (situation)
        {
        case 0:
            break;

        case 1:
            waitingForNextRound = true;
            teris1.MoveBack();
            teris2.MoveBack();
            if (isDown)
            {
                AddToGridNew2(teris1, teris2);
            }
            break;

        case 2:
            waitingForNextRound = true;

            teris2.MoveBack();
            teris2.CheckClash(teris1);
            if (isDown)
            {
                AddToGridNew(teris2);
            }
            break;

        case 3:
            waitingForNextRound = true;

            teris1.MoveBack();
            teris1.CheckClash(teris2);
            if (isDown)
            {
                AddToGridNew(teris1);
            }
            break;
        }
    }