Ejemplo n.º 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);
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 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();
        }
    }
Ejemplo n.º 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
    }
Ejemplo n.º 5
0
 public override void onSwipeAdded(JSFGamePiece gp, bool isBoardCheck)
 {
     JSFSwipeManager.allowAnyColorOnce();         // this is the rainbow piece after all!
 }
Ejemplo n.º 6
0
 void OnMouseEnter()
 {
     JSFSwipeManager.swipeCall(gm.iBoard(arrayRef));         // make a swipe chain call
 }
Ejemplo n.º 7
0
 void OnMouseDown()
 {
     JSFSwipeManager.swipeStart(gm.iBoard(arrayRef));         // start a swipe call
 }