Exemplo n.º 1
0
    private void Update()
    {
        if (!active)
        {
            return;
        }

        if (Time.time - previousTime > TetrisSettings.FallTime)
        {
            /*bool moveValid = true;
             *
             * while (moveValid)
             * {
             *  moveValid = MoveIfValid(0, -1);
             * }*/

            if (!MoveIfValid(0, -1))
            {
                if (!CheckForGameOver())
                {
                    AddToGrid();
                    grid.GetLines();
                    controller.BlockPlaced(grid.LastState);
                    active = false;
                }
            }

            previousTime = Time.time;
        }
    }