示例#1
0
    // function called when user starts the first swipe touch (the first piece)
    public override bool useAsFirstSwipe(JSFGamePiece gp, bool isBoardCheck)
    {
        // isBoardCheck == true if the board is checking for legal swipes (use it in if-else when needed!)
        // return true to allow SwipeManager to use this piece as a starting swipe
        // return false to NOT allow SwipeManager to use this piece as a starting swipe

        JSFSwipeManager.allowAnyColorOnce();
        return(true);
    }
示例#2
0
    // function called when user starts the first swipe touch (the first piece)
    public override bool useAsFirstSwipe(JSFGamePiece gp, bool isBoardCheck)
    {
        // isBoardCheck == true if the board is checking for legal swipes (use it in if-else when needed!)
        // return true to allow SwipeManager to use this piece as a starting swipe
        // return false to NOT allow SwipeManager to use this piece as a starting swipe

        // below is the default behaviour
        // if it's not a special... set the swipeColor to the slotNum; use as first swipe
        JSFSwipeManager.allowAnyColorOnce();         // rainbow swipe the next piece..
        return(true);
    }
示例#3
0
    public static void onBoardReset()       // called after board reset happens
    {
        JSFSwipeManager.voidCurrentSwipe(); // voids any left over swipe on the old board
        // -----------------------------------
        // your own stuff here...
        // -----------------------------------

        if (dlgOnBoardReset != null)
        {
            dlgOnBoardReset.Invoke();
        }
    }
示例#4
0
    // only used these functions...
    // view more ovveridable functions in PieceDefinition.cs script itself OR
    // check out aPieceTemplate.cs script

    public override bool powerMerge(List <JSFBoard> chain, JSFGamePiece target,
                                    JSFGamePiece refPiece, int[] arrayRef, bool isACheck)
    {
        if (target.pd is JSFNormalPiece && (JSFSwipeManager.lastSwipeChainBoard == target.master ||
                                            JSFSwipeManager.lastSwipeChainBoard == refPiece.master)) // ensure we are only looking at the last swiped
        {
            JSFSwipeManager.swipeColor = target.slotNum;
            if (!isACheck)
            {
                StartCoroutine(specialFiveColored(arrayRef, target, refPiece, target.slotNum, 2f, true)); // do a power merge power
            }
            return(true);                                                                                 // <--- has power merge
        }
        if (target.pd is JSFVerticalPiece || target.pd is JSFHorizontalPiece)
        {
            if (!isACheck)
            {
                StartCoroutine(doPowerMergeFiveVH(arrayRef, target, refPiece, 1.5f, target.slotNum)); // do a power merge power
            }
            JSFSwipeManager.stopFurtherSwipes();                                                      // do not allow further swipes
            return(true);                                                                             // <--- has power merge
        }
        if (target.pd is JSFBombPiece)
        {
            if (!isACheck)
            {
                StartCoroutine(doPowerMergeFiveX(arrayRef, target, refPiece, target.slotNum)); // do a power merge power
            }
            JSFSwipeManager.stopFurtherSwipes();                                               // do not allow further swipes
            return(true);                                                                      // <--- has power merge
        }
        if (target.pd is JSFSpecialFive)
        {
            if (!isACheck)
            {
                doPowerMergeFiveFive(arrayRef, target, refPiece); // do a power merge power
            }
            JSFSwipeManager.stopFurtherSwipes();                  // do not allow further swipes
            return(true);                                         // <--- has power merge
        }
        return(false);                                            // <--- no power merge
    }
示例#5
0
 public override void onSwipeAdded(JSFGamePiece gp, bool isBoardCheck)
 {
     JSFSwipeManager.allowAnyColorOnce();         // this is the rainbow piece after all!
 }
示例#6
0
 void OnMouseEnter()
 {
     JSFSwipeManager.swipeCall(gm.iBoard(arrayRef));         // make a swipe chain call
 }
示例#7
0
 void OnMouseDown()
 {
     JSFSwipeManager.swipeStart(gm.iBoard(arrayRef));         // start a swipe call
 }