void FlappyDies()
 {
     GameStateManager.GameState = GameState.Dead;
     DeathGUI.SetActive(true);
     GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);
     GameObject.Find("EventSystem").GetComponent <Connexion>().DieWithScore(ScoreManagerScript.Score);
 }
Esempio n. 2
0
 void PlayerDies()
 {
     GameStateManager.GameState = GameState.Dead;
     DeathGUI.SetActive(true);
     GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);
     anim.SetBool("dead", true);
 }
Esempio n. 3
0
 void FlappyDies()
 {
     MainMenuScript.RequestInterstitial();
     GameStateManager.GameState = GameState.Dead;
     DeathGUI.SetActive(true);
     GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);
 }
Esempio n. 4
0
    void FlappyDies()
    {
        GameStateManager.GameState = GameState.Dead;
        DeathGUI.SetActive(true);
        GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);

        processGameEnd();
    }
Esempio n. 5
0
 public void FlappyDies()
 {
     PlayerPrefs.SetInt("highscore", highscore);
     PlayerPrefs.Save();
     ad++;
     PlayerPrefs.SetInt("ad", ad);
     PlayerPrefs.Save();
     Score.SetActive(false);
     ScoreDie.GetComponent <Text>().text = "Score " + score;
     BestDie.GetComponent <Text>().text  = "Best " + highscore;
     DeathGUI.SetActive(true);
     if (ad % 5 == 0)
     {
         AdManager.Instance.ShowInterstitial();
     }
 }
Esempio n. 6
0
 void FlappyDies()
 {
     scoreoffend.SetActive(false);
     SoundsController.PlaySound(soundsGame.die);
     SoundsController.PlaySound(soundsGame.hit);
     TreeMoving.MoveSpeed       = 0;
     TreeMoving.movey           = 0;
     GrassMoving.MoveSpeed      = 0;
     BackgroundMoving.MoveSpeed = 0;
     GameStateManager.GameState = GameState.Dead;
     myani.SetTrigger("BirdDie");
     DeathGUI.SetActive(true);
     menu.SetActive(true);
     cam.SetTrigger("CamDie");
     GetComponent <Rigidbody2D>().gravityScale = 1.2f;
     XuliHighScore();
 }
    void FlappyDies()
    {
        Save save = new Save();

        save.Score = ScoreManagerScript.Score;

        _gameService?.SaveGame("FloppyBird_SAVE_" + Time.time,
                               "FloppyBirdSaveDone"
                               , null, JsonConvert.SerializeObject(save),
                               c =>
        {
            Res = "SaveGame with " + ScoreManagerScript.Score + " Done!!";
        }, e =>
        {
            Error = "SaveGame Error : " + e;
        });


        GameStateManager.GameState = GameState.Dead;
        DeathGUI.SetActive(true);
        GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);
    }
 public void RestartGame()
 {
     if (GameStateManager.GameState == GameState.Dead)
     {
         GameStateManager.GameState = GameState.Intro;
         DeathGUI.SetActive(false);
         IntroGUI.SetActive(true);
         Transform[] trans = PipeHolder.GetComponentsInChildren <Transform>();
         foreach (Transform t in trans)
         {
             if (t == PipeHolder.transform)
             {
             }
             else
             {
                 Destroy(t.gameObject);
             }
         }
         this.transform.position = originalPosition;
         //Application.LoadLevel(Application.loadedLevelName);
     }
 }
Esempio n. 9
0
    void FlappyDies()
    {
        ScoreManagerScript.score.gameObject.SetActive(false);

        FiroozehGameService.Instance.SaveGame("FloppyBird_SAVE_" + Time.time,
                                              "FloppyBirdSaveDone"
                                              , new Save {
            Score = ScoreManagerScript.Score
        },
                                              c =>
        {
            Res = "SaveGame with " + ScoreManagerScript.Score + " Done!!";
        }, e =>
        {
            Error = "SaveGame Error : " + e;
        });


        GameStateManager.GameState = GameState.Dead;
        ScoreManagerScript.Score   = 0;
        DeathGUI.SetActive(true);
        GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);
    }
Esempio n. 10
0
 private void Awake()
 {
     IntroGUI.SetActive(true);
     DeathGUI.SetActive(false);
 }
 void PsycheDies()
 {
     GameStateManager.GameState = GameState.Dead;
     DeathGUI.SetActive(true);
     GetComponent <AudioSource>().PlayOneShot(DeathAudioClip);
 }
 void FlappyDies()
 {
     GameStateManager.GameState = GameState.Dead;
     DeathGUI.SetActive(true);
     audio.PlayOneShot(DeathAudioClip);
 }
Esempio n. 13
0
 void FlappyDies()
 {
     GameStateManager.GameState = GameState.Dead;
     DeathGUI.SetActive(true);
 }
    // Update is called once per frame
    void Update()
    {
        //handle back key in Windows Phone
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }

        if (GameStateManager.GameState == GameState.Intro)
        {
            MoveBirdOnXAxis();
            if (WasTouchedOrClicked())
            {
                BoostOnYAxis();
                GameStateManager.GameState = GameState.Playing;
                IntroGUI.SetActive(false);
                ScoreManagerScript.Score = 0;
            }
        }

        else if (GameStateManager.GameState == GameState.Playing)
        {
            MoveBirdOnXAxis();
            if (WasTouchedOrClicked())
            {
                BoostOnYAxis();
            }
        }

        else if (GameStateManager.GameState == GameState.Dead)
        {
            Vector2 contactPoint = Vector2.zero;

            if (Input.touchCount > 0)
            {
                contactPoint = Input.touches[0].position;
            }
            if (Input.GetMouseButtonDown(0))
            {
                contactPoint = Input.mousePosition;
            }

            //check if user wants to restart the game
            if (restartButtonGameCollider == Physics2D.OverlapPoint(Camera.main.ScreenToWorldPoint(contactPoint)))
            {
                this.gameObject.transform.position = new Vector3(0, 0, 0);
                this.gameObject.transform.rotation = new Quaternion(0, 0, 0, 0);
                GameStateManager.GameState         = GameState.Intro;
                foreach (GameObject pipe in GameObject.FindGameObjectsWithTag("Pipe"))
                {
                    Destroy(pipe);
                }

                IntroGUI.SetActive(false);
                DeathGUI.SetActive(false);
                Score.SetActive(false);
                Canvas.SetActive(true);
                MenuGUI.SetActive(true);
                this.gameObject.SetActive(false);
            }
        }
    }