コード例 #1
0
 public virtual void DoShift()
 {
     if (shifting == 0)
     {
         return;
     }
     if (shiftall)
     {
         if (isShown)
         {
             PD.sounds.SetSoundAndPlay(SoundPaths.S_ShiftRows);
         }
         if (shifting > 0)
         {
             cursor.shiftX((cursor.getX() == width - 1) ? (-width + 1) : 1);
             cursor.DoUpdate();
             for (int i = 0; i < height; i++)
             {
                 ShiftRow(i, 1);
                 changes.Add(new MirrorChangeShift(i, 1));
             }
         }
         else if (shifting < 0)
         {
             cursor.shiftX((cursor.getX() == 0) ? (width - 1) : -1);
             cursor.DoUpdate();
             for (int i = 0; i < height; i++)
             {
                 ShiftRow(i, -1);
                 changes.Add(new MirrorChangeShift(i, -1));
             }
         }
     }
     else
     {
         if (isShown)
         {
             PD.sounds.SetSoundAndPlay(SoundPaths.S_ShiftRow);
         }
         if (shifting > 0)
         {
             ShiftRow(cursor.getY(), 1);
             changes.Add(new MirrorChangeShift(cursor.getY(), 1));
         }
         else if (shifting < 0)
         {
             ShiftRow(cursor.getY(), -1);
             changes.Add(new MirrorChangeShift(cursor.getY(), -1));
         }
     }
     actionDelay = PD.KEY_DELAY;
 }
コード例 #2
0
 public override void DoUpdate(int max = -1)
 {
     cursor.GetComponent <SpriteRenderer>().sprite = sheet[parent.frozen?2:(parent.penetr?1:0)];
     x = boardwidth - 1 - parent.getX();
     y = boardheight - 1 - parent.getY();
     UpdateMirrorCursorPos();
     FinishUpdate();
 }
コード例 #3
0
ファイル: GameController.cs プロジェクト: ozgurtt/Blockara
    private void ImUsingTouchControlsInATutorial()
    {
        int change = touchHandler.HandleUpdate(clicker);

        cursor1.setY(touchHandler.rowY);
        if (touchHandler.aboveEverything)
        {
            board1.shiftall = true;
        }
        if (!touchHandler.aboveEverything || change == 0)
        {
            cursor1.setX(touchHandler.rowX);
        }
        if (change != 0 && tutorialAssist.IsActionAllowed((board1.shiftall?1:0), cursor1.getX(), cursor1.getY()))
        {
            board1.shifting = change;
        }
        else if (touchHandler.launching && tutorialAssist.IsActionAllowed(2, cursor1.getX(), cursor1.getY()))
        {
            board1.SetLaunchInfoForLaunch();
        }
    }
コード例 #4
0
    public void DoUpdate(BoardCursorActualCore c, BoardCursorActualCore c2)
    {
        switch (tutState)
        {
        case -1:
            if (--negativeonetimer == 0)
            {
                newState();
            }
            break;

        case 0:
            if (c.getX() == 4 && c.getY() == 5)
            {
                Destroy(highlight); newState();
            }
            break;

        case 1:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == 1)
            {
                newState();
            }
            break;

        case 2:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == 1 && bo1.GetValueAtXY(4, 4).GetColorVal() == 1)
            {
                newState();
            }
            break;

        case 3:
            if (bo1.launchInfo.launching)
            {
                newState();
            }
            break;

        case 4:
            if (bo2.GetHighestYAtX(3) == 3)
            {
                newState();
            }
            break;

        case 5:
            if (bo2.GetHighestYAtX(3) == 2)
            {
                newState();
            }
            break;

        case 6:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == 1 && bo1.GetValueAtXY(4, 4).GetColorVal() == 1)
            {
                newState();
            }
            break;

        case 7:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == 1 && bo1.GetValueAtXY(4, 4).GetColorVal() == 1 && bo1.GetValueAtXY(4, 3).GetColorVal() == 1)
            {
                newState();
            }
            break;

        case 8:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == 1 && bo1.GetValueAtXY(4, 4).GetColorVal() == 1 && bo1.GetValueAtXY(4, 3).GetColorVal() == 1 && bo1.GetValueAtXY(4, 2).GetColorVal() == 1 && bo1.GetValueAtXY(4, 1).GetColorVal() == 1)
            {
                newState();
            }
            break;

        case 9:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == 1 && bo1.GetValueAtXY(4, 4).GetColorVal() == 1 && bo1.GetValueAtXY(4, 3).GetColorVal() == 1 && bo1.GetValueAtXY(4, 2).GetColorVal() == 1 && bo1.GetValueAtXY(4, 1).GetColorVal() == 1 && bo1.GetValueAtXY(4, 0).GetColorVal() == 1)
            {
                newState();
            }
            break;

        case 10:
            if (bo2.GetHighestYAtX(3) < 0)
            {
                newState();
            }
            break;

        case 11:
            if (bo1.GetValueAtXY(4, 5).GetColorVal() == bo1.GetValueAtXY(4, 4).GetColorVal() && bo1.GetValueAtXY(4, 3).GetColorVal() == bo1.GetValueAtXY(4, 4).GetColorVal())
            {
                ForceCursor2ToShift(c2, 1); newState();
            }
            break;

        case 12:
            if (bo2.GetHighestYAtX(3) < 0)
            {
                ForceCursor2ToShift(c2, 2); newState();
            }
            break;

        case 13:
            if (bo1.GetValueAtXY(3, 5).GetColorVal() == bo1.GetValueAtXY(3, 4).GetColorVal() && bo1.GetValueAtXY(3, 3).GetColorVal() == bo1.GetValueAtXY(3, 4).GetColorVal())
            {
                newState();
            }
            break;

        case 14:
            if (bo1.launchInfo.launching)
            {
                newState();
            }
            break;

        case 15:
            bo2.BeDefeated(); tutState++;
            break;
        }
    }