Example #1
0
    private void UpdateGridFull(bool wasFull, bool isFull)
    {
      if (settings.noScrolling == false)
      {
        // Timer stuff
        if (wasFull == false && isFull)
        {
          timeBeforeGameOverMax = LAST_CHANCE_DURATION;
          timeBeforeGameOverCurrent = timeBeforeGameOverMax;
        }

        else if (isFull && !grid.IsFrozen)
        {
          float factor = isSpeeding ? 2 : 1;
          timeBeforeGameOverCurrent -= (DeltaTime * factor);

          if (timeBeforeGameOverCurrent <= 0)
          {
            // :(
            Log.Warning(" GAME OVER for " + player);
            SetGameOver();
            OnGameOver.Raise(this);
          }
        }
      }
    }