Exemplo n.º 1
0
    private void Surrender(string idPlayer)
    {
        int num = LANPPH.GetNumById(idPlayer);

        itGameOverArr[num] = true;
        game.GameOver(num);
    }
Exemplo n.º 2
0
    public void MoveDown()     //метод движения объекта (фигуры) вниз
    {
        if (itStone != true)
        {
            transform.position += new Vector3(0, -stepSize, 0);
            Debug.Log(DateTime.Now.ToString("hh:mm:ss:ffff") + ": Принят сигнал на движение вниз для объекта " + this.name
                      + " игрока с id: " + this.IdPlayer);

            if (CheckValidPosition())
            {
                game.SynchronizedTetromino(this.IdPlayer, this.transform.position, this.transform.rotation);
                game.UpdateGrid(this, this.IdPlayer);
            }
            else
            {
                Debug.Log(DateTime.Now.ToString("hh:mm:ss:ffff") + ": Движение вниз для объекта " + this.name
                          + " игрока с id: " + this.IdPlayer + " недопустимо! "
                          + "Производится обратное движение вверх и остановка фигуры");

                transform.position += new Vector3(0, stepSize, 0);

                Debug.Log(this);
                game.DeleteRow(this.IdPlayer);

                enabled = false;

                game.SynchronizedTetromino(this.IdPlayer, this.transform.position, this.transform.rotation);

                game.itRowDelete = false;

                game.SpawnNextTetromino(this.IdPlayer);

                if (game.ItGameOver(this))
                {
                    game.GameOver(this.IdPlayer);
                }
            }
        }
    }