Exemplo n.º 1
0
    List <Gem> FallColumn(int x)
    {
        List <Gem> movedGems = new List <Gem>();

        for (int y = 0; y < boardHeigth - 1; y++)
        {
            if (gems[x, y] == null)
            {
                //Debug.Log(x+" , "+y+"NotFound");
                for (int i = y + 1; i < boardHeigth; i++)
                {
                    if (gems[x, i] != null)
                    {
                        Gem moveGem = gems[x, i];
                        movedGems.Add(moveGem);

                        moveGem.Fall(y);


                        maxFallDistance = (maxFallDistance > (i - y)) ? maxFallDistance : (i - y);

                        break;
                    }
                }
            }
        }
        return(movedGems);
    }