public void characterIsClicked(MyCharacterController characterCtrl)
    {
        if (characterCtrl.isOnBoat())
        {
            bankController whichbank;
            if (boat.get_to_or_from() == -1)                // to->-1; from->1
            {
                whichbank = tobank;
            }
            else
            {
                whichbank = frombank;
            }

            boat.GetOffBoat(characterCtrl.getName());

            //characterCtrl.moveToPosition (whichbank.getEmptyPosition ());  改为如下语句
            Vector3 dest = whichbank.getEmptyPosition();
            actionManager.moveChar(characterCtrl, dest, speed);

            characterCtrl.getOnbank(whichbank);
            whichbank.getOnbank(characterCtrl);
        }
        else                                                                                    // character on bank
        {
            bankController whichbank = characterCtrl.getbankController();

            if (boat.getEmptyIndex() == -1)                             // boat is full
            {
                return;
            }

            if (whichbank.get_to_or_from() != boat.get_to_or_from())                    // boat is not on the side of character
            {
                return;
            }

            whichbank.getOffbank(characterCtrl.getName());

            //characterCtrl.moveToPosition (boat.getEmptyPosition());  改为如下语句
            Vector3 dest = boat.getEmptyPosition();             //boat,not whichbank
            actionManager.moveChar(characterCtrl, dest, speed);

            characterCtrl.getOnBoat(boat);
            boat.GetOnBoat(characterCtrl);
        }
        userGUI.status = check_game_over();

        //judge.judge(userGUI.status);
    }
예제 #2
0
    public void characterIsClicked(MyCharacterController characterCtrl)
    {
        if (characterCtrl.isOnBoat())
        {
            bankController whichbank;
            if (boat.get_to_or_from() == -1)
            {
                whichbank = tobank;
            }
            else
            {
                whichbank = frombank;
            }

            boat.GetOffBoat(characterCtrl.getName());

            Vector3 dest = whichbank.getEmptyPosition();
            actionManager.moveChar(characterCtrl, dest, speed);

            characterCtrl.getOnbank(whichbank);
            whichbank.getOnbank(characterCtrl);
        }
        else
        {
            bankController whichbank = characterCtrl.getbankController();

            if (boat.getEmptyIndex() == -1)
            {
                return;
            }

            if (whichbank.get_to_or_from() != boat.get_to_or_from())
            {
                return;
            }

            whichbank.getOffbank(characterCtrl.getName());

            Vector3 dest = boat.getEmptyPosition();
            actionManager.moveChar(characterCtrl, dest, speed);

            characterCtrl.getOnBoat(boat);
            boat.GetOnBoat(characterCtrl);
        }
        userGUI.status = check_game_over();
    }