Beispiel #1
0
    public void OnUpdate()
    {
        gameplayManager.PositionUpdate();
        gameplayManager.GravityUpdate();
        if (gameplayManager.isStability)
        {
            //gameplayManager.GravityUpdate();
            list = gameplayManager.Match();
            while (list != null)
            {
                gameplayManager.RemoveCells(list);
                //gameplayManager.GravityUpdate();                           --
                list = gameplayManager.Match();
                //gameplayManager.GravityUpdate();
            }

            if (gameplayManager.haveEmptyCells)
            {
                //gameplayManager.GravityUpdate();
                gameplayManager.FillStartRow();
                gameplayManager.GravityUpdate();
            }
            else
            {
                list = gameplayManager.Match();
                if (list == null && !gameplayManager.haveEmptyCells)
                {
                    gameplayManager.state = new InputState(gameplayManager);
                }
            }
        }
    }
Beispiel #2
0
 public void OnUpdate()
 {
     if (gameplayManager.isStability)
     {
         var matches = gameplayManager.Match();
         if (matches != null)
         {
             //gameplayManager.RemoveCells(matches);
             gameplayManager.state = new UpdatingState(gameplayManager);
         }
         else
         {
             gameplayManager.SwapCells(col, row, tmpCol, tmpRow);
             gameplayManager.state = new UpdatingState(gameplayManager);
         }
     }
 }