Beispiel #1
0
 private void Lose()
 {
     if (GameMode.Mode == GameMode.GameModes.Minigame)
     {
         GetComponent <Animator>().SetTrigger("Lose");
         MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>();
         minigameModeController.OnMinigameFinished(false, "Orgulho");
     }
     else
     {
         GetComponent <Animator>().SetTrigger("Lose");
         LivesController.RemVidas();
         GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
     }
 }
Beispiel #2
0
    public void RostoErrado()
    {
        faceClick = true;
        GameObject[] certos = GameObject.FindGameObjectsWithTag("Certo");
        foreach (GameObject certo in certos)
        {
            certo.gameObject.transform.GetChild(0).gameObject.SetActive(true);
        }
        LivesController.RemVidas();

        foreach (GameObject botao in listaDeBotoesInstanciados)
        {
            botao.GetComponent <Button>().enabled = false;
        }

        GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
    }
Beispiel #3
0
 private void LoseGame()
 {
     if (GameMode.Mode == GameMode.GameModes.Minigame)
     {
         lost = true;
         canvas.GetComponent <Animator>().SetBool("Lost", true);
         MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>();
         minigameModeController.OnMinigameFinished(false, "Ira");
     }
     else
     {
         lost = true;
         LivesController.RemVidas();
         canvas.GetComponent <Animator>().SetBool("Lost", true);
         GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
     }
 }
Beispiel #4
0
    public void Perdeu(string callerScene)
    {
        if (GameMode.Mode == GameMode.GameModes.Minigame)
        {
            MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>();
            minigameModeController.OnMinigameFinished(false, callerScene);
        }
        else
        {
            Screen.orientation = ScreenOrientation.AutoRotation;
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
            LivesController.RemVidas();
#if UNITY_ANDROID
            Screen.orientation = ScreenOrientation.Landscape;
            Screen.orientation = ScreenOrientation.AutoRotation;
#endif
        }
    }
 // Perde o minigame
 private void Lose()
 {
     if (GameMode.Mode == GameMode.GameModes.Minigame)
     {
         hasGameEnded = true;
         DestroyAllFoods();
         GetComponent <Animator>().SetTrigger("Lose");
         MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>();
         minigameModeController.OnMinigameFinished(false, "Gula");
     }
     else
     {
         hasGameEnded = true;
         DestroyAllFoods();
         GetComponent <Animator>().SetTrigger("Lose");
         LivesController.RemVidas();
         GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
         Screen.orientation = ScreenOrientation.Landscape;
         Screen.orientation = ScreenOrientation.AutoRotation;
     }
 }
Beispiel #6
0
    private void LoseGame()
    {
        if (GameMode.Mode == GameMode.GameModes.Minigame)
        {
            MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>();
            minigameModeController.OnMinigameFinished(false, "Preguiça");
        }
        else
        {
            LivesController.RemVidas();
            DespawnBeds();
            animator.SetTrigger("lose");

            // BUG FIX
            int nCurrentLives = LivesController.GetVidas();
            if (nCurrentLives == nInitialLives - 2)
            {
                LivesController.addVidas();
            }

            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
        }
    }
    public void RostoErrado()
    {
        if (!faceClick)
        {
            faceClick = true;

            foreach (GameObject errado in listaErrado)
            {
                errado.GetComponent <Animator>().SetBool("FadeOut", true);
                errado.GetComponent <Button>().enabled = false;
            }

            if (GameMode.Mode == GameMode.GameModes.Minigame)
            {
                MinigameModeController minigameModeController = FindObjectOfType <MinigameModeController>();
                minigameModeController.OnMinigameFinished(false, "Inveja");
            }
            else
            {
                LivesController.RemVidas();
                GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
            }
        }
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        switch (collision.gameObject.tag)
        {
        case "EnemyIra":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }

            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Ira", collision.transform.position, FadeController.IRA);
                Destroy(collision.gameObject);
            }

            break;

        case "EnemyPreguica":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }

            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Preguiça", collision.transform.position, FadeController.PREGUICA);
                Destroy(collision.gameObject);
            }
            break;

        case "EnemyGanancia":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }
            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Ganancia", collision.transform.position, FadeController.GANANCIA);
                Destroy(collision.gameObject);
            }
            break;

        case "EnemyInveja":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }

            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Inveja", collision.transform.position, FadeController.INVEJA);
                Destroy(collision.gameObject);
            }
            break;

        case "EnemyGula":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }

            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Gula", collision.transform.position, FadeController.GULA);
                Destroy(collision.gameObject);
            }
            break;

        case "EnemyOrgulho":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }

            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Orgulho", collision.transform.position, FadeController.SOBERBA);
                Destroy(collision.gameObject);
            }
            break;

        case "EnemyLuxuria":
            if (GetComponent <PlayerMovement>().isImortal())
            {
                goto imortal;
            }

            Vibrar();
            if (GameMode.Mode == GameMode.GameModes.Endless)
            {
                Destroy(collision.gameObject);
                LivesController.RemVidas();
                player.viraDeus_Backminigame();
            }
            else
            {
                GetComponent <Animator>().enabled = false;
                fadeImage.FadeFromColision("Luxuria", collision.transform.position, FadeController.LUXURIA);
                Destroy(collision.gameObject);
            }
            break;
        }
        return;

        //caso esteja imortal
imortal:
        GetComponent <PlayerMovement>().sobeCarinha();
        Destroy(collision.gameObject);
        return;
    }
Beispiel #9
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.F1))
        {
            GameObject.Find("Player").GetComponent <PlayerMovement>().viraDeus();
        }

        if (Input.GetKeyUp(KeyCode.M))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Main");
        }

        if (Input.GetKeyUp(KeyCode.G))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Ganancia");
        }

        if (Input.GetKeyUp(KeyCode.I))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Ira");
        }

        if (Input.GetKeyUp(KeyCode.P))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Preguiça");
        }

        if (Input.GetKeyUp(KeyCode.V))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Inveja");
        }

        if (Input.GetKeyUp(KeyCode.C))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Gula");
        }

        if (Input.GetKeyUp(KeyCode.S))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Soberba"); //Orgulho
        }
        if (Input.GetKeyUp(KeyCode.L))
        {
            GameObject.Find("FadeImage").GetComponent <FadeController>().CallFading("Luxuria");
        }

        if (Input.GetKeyUp(KeyCode.LeftShift))
        {
            GameObject.Find("Player").GetComponent <PlayerMovement>().sobeCarinha();
        }

        if (Input.GetKeyUp(KeyCode.PageUp))
        {
            LivesController.addVidas();
        }

        if (Input.GetKeyUp(KeyCode.PageDown))
        {
            LivesController.RemVidas();
        }

        //BotaoPausa
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            //se tiver em transicao, nao pausa o jogo.
            //se tiver em minigame nao pausa o jogo

            if (GameObject.Find("FadeImage").GetComponent <FadeController>().EmTransicao == true ||
                !SceneManager.GetActiveScene().Equals(SceneManager.GetSceneByName("Main")))
            {
                goto fim;
            }

            if (Time.timeScale == 0)//se já estiver pausado
            {
                GameObject.Find("PauseMenu").GetComponent <PauseMenuController>().AtivaMenu(false);
            }

            else //nao está pausado
            {
                GameObject.Find("PauseMenu").GetComponent <PauseMenuController>().AtivaMenu(true);
            }

fim:
            ;//nop operation
        }
    }