Exemplo n.º 1
0
    private void NewLevel()
    {
        _board.ResetBoard();
        _pacman.Initialize();

        for (int i = 0; i < _ghosts.Length; i++)
        {
            _ghosts[i].Initialize();
            _ghostTiles[i] = _board.GetTile(_ghosts[i].transform.position);
        }

        _permaChase        = false;
        _ongoingFright     = false;
        _currentAlternance = 0;
        _dotsLefts         = _board.DotCount;
        CurrentGhostState  = GhostState.Scatter;

        _textMessage.gameObject.SetActive(true);
        _textMessage.text = _LEVEL_START;
        _levelStartTime   = Time.time;
        _levelStarted     = false;

        _currentBonusIndex  = 0;
        _timesinceLastBonus = 0;
        _board.BonusTile.Collectable.gameObject.SetActive(false);
    }