Exemplo n.º 1
0
 private void SwapEnded(AnimatingElement ae)
 {
     if (CheckMatches(true) > 0)
     {
         DropPieces();
     }
     else
     {
         GamePiece g1 = board[sourceX, sourceY];
         GamePiece g2 = board[targetX, targetY];
         board[sourceX, sourceY] = g2;
         board[targetX, targetY] = g1;
         g1.SlideTo(boardX + targetX * blockSize, boardY + targetY * blockSize, null);
         g2.SlideTo(boardX + sourceX * blockSize, boardY + sourceY * blockSize, null);
         state = NONE;
     }
 }
Exemplo n.º 2
0
        private void DropEnded(AnimatingElement ae)
        {
            this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                AddNewPieces();

                if (CheckMatches(false) > 0)
                {
                    DropPieces();
                }
                else
                {
                    state = NONE;
                }
            });
        }