Exemplo n.º 1
0
 private void DropHeldItem()
 {
     if (!grid.lookTetrominoAdding)
     {
         heldItem.DropObject();
         grid.TryToSnapPosition(ref heldItem);
         heldItem = null;
         itemHeld = false;
     }
     else
     {
         grid.SetStatusMessage("Wait until last tetromino is down... ");
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Detect if game is over if not and timer is up trigger tetromino generation
    /// </summary>
    void Update()
    {
        GameObject[] tetrominosInGame = GameObject.FindGameObjectsWithTag("OnHeap");

        if (tetrominosInGame.Length > 3)
        {
            grid.SetStatusMessage("GAME OVER");
        }
        else if (deltaTime <= 0)
        {
            LoadNewTetro();
            deltaTime = maxTime;
        }
        else
        {
            deltaTime -= Time.deltaTime;
        }
    }