CreateDisappearTransition() public method

Creates a transition which disappears the block and spawns a score label in its place, which will itself disappear after some time.
public CreateDisappearTransition ( int score ) : U9Transition,
score int Score.
return U9Transition,
Ejemplo n.º 1
0
    /// <summary>
    /// Causes all blocks to disappear
    /// </summary>
    /// <returns>The clear board transition.</returns>
    U9Transition CreateClearBoardTransition()
    {
        List <U9Transition> transitions = new List <U9Transition> ();

        for (int i = 0, ni = gridSize; i < ni; i++)
        {
            for (int j = 0, nj = gridSize; j < nj; j++)
            {
                Block b = blocks [i, j];
                if (b)
                {
                    transitions.Add(b.CreateDisappearTransition(0));
                }
            }
        }

        // Randomises the order of the disappear transitions to make it more pretty!
        List <U9Transition> randomisedTransitions = GetRandomSubset(transitions, transitions.Count);

        float staggerTime = 0.025f;         // 0.025f;

        return(U9T.Stagger(staggerTime, randomisedTransitions.ToArray()));
    }