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