Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        UpdateHighScoresAndTimes();

        highScore        = PlayerPrefs.GetInt("HighScore");
        highSurvivalTime = PlayerPrefs.GetInt("HighSurvivalTime");



        uIManager    = FindObjectOfType <UIManager>();
        soundManager = FindObjectOfType <SoundManager>();

        uIManager.UpdateLives(lives);
        uIManager.UpdateLevel(Level);
        uIManager.UpdateHighScoresAndTimes();

        pacmanMove = FindObjectOfType <PacmanMove>();
        AssignGhosts();
        pellets.AddRange(GameObject.FindGameObjectsWithTag("Pellets"));
        initialpellets = pellets.Count;


        EveryoneStop();
        StartCoroutine(ResetEveryone(2));
        //StartCoroutine(StartGameCoroutine());
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     astar            = GetComponent <AStarAlgorithm>();
     pacmanController = GameObject.FindGameObjectWithTag("Pacman").GetComponent <PacmanMove>();
     pacmanTransform  = GameObject.FindGameObjectWithTag("Pacman").transform;
     gameManager      = FindObjectOfType <GameManager>();
     movementMode     = MovementMode.Waiting;
     blinkyTransform  = GameObject.Find("Blinky").transform;
     animator         = GetComponent <Animator>();
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     _ghosts = ghosts;
     _playAgainButton = playAgainButton;
     _pacman = GameObject.Find("pacman").GetComponent<PacmanMove>();
     _playAgainButton.gameObject.SetActive(false);
     _playAgainButton.onClick.AddListener(delegate
     {
         restartGame();
     });
 }
Ejemplo n.º 4
0
    // Use this for initialization
    void Awake()
    {
        pacman = FindObjectOfType <PacmanMove>();
        speed  = pacman.speed;

        if (type == GhostType.Chaser)         //store this so blue ghost can access it
        {
            chaseGhost = this;
        }

        start   = transform.position;
        dest    = start;
        atStart = true;
        Wait(delayAtStart);
    }    //Awake
Ejemplo n.º 5
0
    void Start()
    {
        currentLives = lifes;
        pacmanMove   = GetComponent <PacmanMove>();

        if (liveUI == null)
        {
            Debug.LogError("No LiveUi assigned" + name);
            Destroy(this);
        }
        else
        {
            liveUI.SetLives(lifes);
        }
    }
Ejemplo n.º 6
0
 void Awake()
 {
     pacmanMover = FindObjectOfType <PacmanMove>();
 }    //Awake
Ejemplo n.º 7
0
 void Start()
 {
     pacmanController = FindObjectOfType <PacmanMove>();
 }