Exemple #1
0
    public void AddScoop(Scoop scoop)
    {
        // Debug_ScoopList("Adding scoop: " + scoop.flavor + " to scoop List", scoopStack);
        // Debug_ScoopList("scoop.scoopStack: ",scoop.scoopStack);
        if (scoop.scoopStack.Count > 0)
        {
            return;
        }
        scoop.CalculateConsecutiveFlavors(scoopStack);
        scoopStack.Add(scoop);
        StartCoroutine(BounceScoops());
        List <StackNode> matches = CheckMatch(scoopStack);

        if (matches.Count > 0)
        {
            Debug.Log("mathces found: " + matches);
            if (handlingMatch)
            {
                StopCoroutine(handleMatchRoutine);
            }
            handleMatchRoutine = StartCoroutine(HandleMatch(matches));
        }
        else if (StackHeight() == board.numberOfRows + 1)
        {
            // Allow the user to be quick if their stack reaches the very top.
            // Also allows the user to catch falling scoops to make a match of 3 at the very top
            board.GameOver();
        }
        // Debug_ScoopList("ScoopStack after merging flying stack: ", scoopStack);
    }
Exemple #2
0
 private void PutScoopOnStack(Scoop scoop)
 {
     scoop.CalculateConsecutiveFlavors(scoopStack);
     scoopStack.Add(scoop);
     Debug.Log("Putting scoop : " + scoop.flavor + " on stack at index: " + new Vector2Int(Lane(), StackHeight() - 1));
     scoop.MoveToIndex(new Vector2Int(Lane(), StackHeight() - 1));
 }