Exemplo n.º 1
0
 void DontFuel()//Закончилось топливо
 {
     state = State.Dead;
     audioSource.Stop();
     audioSource.PlayOneShot(loseSound);
     deathMenu.ToggleEndMenu();
 }
Exemplo n.º 2
0
 private void EndGame()
 {
     isAlive = false;
     pauseButton.SetActive(false);
     AdManager.AdInstance.ShowAd();
     deathMenu.ToggleEndMenu(score);
 }
Exemplo n.º 3
0
 public void PauseGame()
 {
     if (!isPaused)
     {
         deathMenu.ToggleEndMenu(score);
         isPaused = true;
     }
     else
     {
         deathMenu.UnToggleEndMenu();
         isPaused = false;
     }
 }
Exemplo n.º 4
0
 public void OnDeath()
 {
     isDeath = true;
     PlayerPrefs.SetFloat("Coin Score", CoinScore);
     deathMenu.ToggleEndMenu(CoinScore);
     ScoreforCoin.CoinScore = 0;
 }
Exemplo n.º 5
0
 public void OnDeath()
 {
     isDeath = true;
     PlayerPrefs.SetFloat("Highscore", score);
     deathMenu.ToggleEndMenu(score);
     Score.score = 0;
 }
Exemplo n.º 6
0
 // Player has died
 void OnGameOver()
 {
     GroundTrans.doSpawn = false;
     Scrolling.gameOver  = true;
     isGameOver          = true;
     deathMenu.ToggleEndMenu(score);  //show the death button when the player died
 }
Exemplo n.º 7
0
    public void OnDeath()
    {
        isDead = true;


        deathMenu.ToggleEndMenu(score);
    }
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     deathMenu.ToggleEndMenu(score);
 }
Exemplo n.º 9
0
    //private void OnCollisionEnter(Collision collision)
    //{
    //    if (collision.gameObject.tag == "Box" || collision.gameObject.tag == "FastBox")
    //    {
    //        Debug.Log("HIIITTT");
    //    }
    //}

    IEnumerator Wait()
    {
        //yield return new WaitForSeconds(2f);
        playerAnimation.CrossFade("Dying");
        yield return(new WaitForSeconds(1.5f));

        playerAnimation.Stop();
        deathMenu.ToggleEndMenu((int)score);
    }
Exemplo n.º 10
0
 public void OnDeath(bool win)
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score); // Set the highest score into Registry
     }
     deathMenu.ToggleEndMenu(score, win);
 }
Exemplo n.º 11
0
 void Die()
 {
     //Debug.Log("Call Die()....");
     isDead = true;
     deathMenu.ToggleEndMenu(health);
     fixedJoystick.ToggleEndMenu();
     jumpBtn.ToggleEndMenu();
     fightBtn.ToggleEndMenu();
 }
Exemplo n.º 12
0
 public void OnDeath()
 {
     iSDead = true;
     if ((int)PlayerPrefs.GetFloat("Highscore") < score)
     {
         NHS.text = "NEW HIGH SCORE!!";
         PlayerPrefs.SetFloat("Highscore", score);
     }
     deathMenu.ToggleEndMenu(score);
 }
Exemplo n.º 13
0
    public void Ondeath()
    {
        isdead = true;
        if (PlayerPrefs.GetFloat("Hig") < score)
        {
            PlayerPrefs.SetFloat("Hig", score);
        }

        deathmenu.ToggleEndMenu(score);
    }
Exemplo n.º 14
0
 public void OnDeath(){
     isDead = true;
     if(PlayerPrefs.GetFloat("HighScore") < score){
         PlayerPrefs.SetFloat("HighScore", score);
     }
     
     deathMenu.ToggleEndMenu(score);
     int coinNumber = GetComponent<PlayerMotor>().coinCounter;
     PlayerPrefs.SetInt("CoinsCount", (PlayerPrefs.GetInt("CoinsCount") + coinNumber));//------ Adding the number of coins to the already stored number of coins.
 }
Exemplo n.º 15
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);            //Saving the score in the registery regedit(software,defaultcompany)
     }
     //PlayerPrefs.GetInt ("Highscore");
     deathMenu.ToggleEndMenu(score);
 }
Exemplo n.º 16
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     scoreObject.SetActive(false);
     deathMenu.ToggleEndMenu(score);
 }
Exemplo n.º 17
0
    // public GameObject completeLevelUI;

    // complete level - we are not completing levels because it is endless sliding
    //public void CompleteLevel()
    //{
    //    Debug.Log("Level Won");
    //    completeLevelUI.SetActive(true);
    //}

    // end game function
    public void EndGame()
    {
        if (gameHasEnded == false)
        {
            gameHasEnded = true;


            //need to set score on death
            deathMenu?.ToggleEndMenu(0f);
        }
    }
Exemplo n.º 18
0
    private void Death()
    {
        m_isDead = true;
        if (PlayerPrefs.GetInt("Highscore") < m_numOfCollisionWithCoin)
        {
            Debug.Log("score2: " + PlayerPrefs.GetInt("Highscore"));
            PlayerPrefs.SetInt("Highscore", m_numOfCollisionWithCoin);
        }

        m_deathMenu.ToggleEndMenu(m_numOfCollisionWithCoin);
    }
Exemplo n.º 19
0
 public void OnDeath()
 {
     isDead = true;
     Debug.Log(PlayerPrefs.GetFloat("HighScore"));
     Debug.Log(score > PlayerPrefs.GetFloat("HighScore"));
     if (score > PlayerPrefs.GetFloat("HighScore"))
     {
         PlayerPrefs.SetFloat("HighScore", score);
     }
     deathMenu.ToggleEndMenu(score);
 }
Exemplo n.º 20
0
 public void OnDeath()
 {
     /*isDead = true;
      * if (PlayerPrefs.GetFloat("Highscore") < score)
      * {
      *  PlayerPrefs.SetFloat("Highscore", score);
      *  deathMenu.newBestText.enabled = true;
      * }
      * coins += coin;
      * PlayerPrefs.SetInt("Coins", coins);*/
     deathMenu.ToggleEndMenu(score, coin);
 }
Exemplo n.º 21
0
    public void OnDeath()
    {
        m_isDead = true;

        //if a new highscore is set update it
        if (PlayerPrefs.GetFloat("Highscore") < m_score)
        {
            PlayerPrefs.SetFloat("Highscore", m_score);
        }

        deathMenu.ToggleEndMenu(m_score); // show death menu
    }
Exemplo n.º 22
0
    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "Obstacle")
        {
            gameObject.SetActive(false);
            isDead = true;

            deathMenu.ToggleEndMenu();
            pauseScript.buttonToggleOff();
            scoreScript.TurnScoreOff();
        }
    }
Exemplo n.º 23
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     Debug.Log("d");
     FindObjectOfType <WhiteScreen>().Kill();
     Debug.Log("d");
     deathMenu.ToggleEndMenu(score);
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("up") || Input.GetButtonDown("down") || Input.GetButtonDown("left") || Input.GetButtonDown("right"))
        {
            move = true;
        }

        if (move)
        {
            if (!isDead)
            {
                //*thePlayer's Z position will always be greater then the camera's Z position
                if (gameObject.transform.position.z < thePlayer.transform.position.z - 1)
                {
                    //lerps the camera towards the player
                    shouldPos = Vector3.Lerp(gameObject.transform.position, thePlayer.transform.position, Time.deltaTime);
                    gameObject.transform.position = new Vector3(shouldPos.x, 1, shouldPos.z);
                }
                else
                {
                    //slowly moves the camera forward until player is a certain amount pass the camera's Z position
                    gameObject.transform.position += Vector3.forward * (Time.deltaTime * speed);
                    gameObject.transform.position  = new Vector3(Mathf.Lerp(gameObject.transform.position.x, thePlayer.transform.position.x, Time.deltaTime), 1, gameObject.transform.position.z);
                }
                if (gameObject.transform.position.x <= -1)
                {
                    gameObject.transform.position = new Vector3(Mathf.Lerp(gameObject.transform.position.x, -1, Time.deltaTime), 1, gameObject.transform.position.z);
                }
                if (gameObject.transform.position.x >= 1)
                {
                    gameObject.transform.position = new Vector3(Mathf.Lerp(gameObject.transform.position.x, 1, Time.deltaTime), 1, gameObject.transform.position.z);
                }
            }
            if (gameObject.transform.position.z > thePlayer.transform.position.z + 5)
            {
                //sets isDead to true and snaps camera to the player's position
                isDead = true;
                thePlayer.GetComponent <Bounce>().isDead = true;
                thePlayer.GetComponent <AnimationController>().isDead = true;
                shouldPos = Vector3.Lerp(gameObject.transform.position, thePlayer.transform.position, Time.deltaTime);
                gameObject.transform.position = new Vector3(shouldPos.x, 1, shouldPos.z - 4);
                deathMenu.ToggleEndMenu();    //calls the death menu
                gameMenu.ToggleOffGameMenu(); //turns off game menu icons
            }
        }
        //this will snap the camera to the player's position when dead
        if (isDead)
        {
            shouldPos = Vector3.Lerp(gameObject.transform.position, thePlayer.transform.position, Time.deltaTime * 2);
            gameObject.transform.position = new Vector3(shouldPos.x, 1, shouldPos.z);
        }
    }
Exemplo n.º 25
0
 //Arret du score quand le joueur perd
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("HighScore Distance :") < score_distance)
     {
         PlayerPrefs.SetFloat("HighScore Distance :", score_distance);
     }
     if (PlayerPrefs.GetFloat("HighScore Piece :") < count_piece)
     {
         PlayerPrefs.SetFloat("HighScore Piece :", count_piece);
     }
     deathMenu.ToggleEndMenu(score_distance, count_piece);
 }
Exemplo n.º 26
0
    public void OnDeath()
    {
        // this method will be called from the playerMotor script;
        // when player collides with onj, this method will be called in PlayerMotor and will stop the Score from increasing
        isDead = true;

        if (PlayerPrefs.GetFloat("Highscore") < score)         // if highscore is smaller than score assign new highscore.
        {
            PlayerPrefs.SetFloat("Highscore", score);          // save the score to the user's device's storage
        }

        deathMenu.ToggleEndMenu(score);         // turns on the death menu, and sends the player's score to be displayed on the death menu
    }
Exemplo n.º 27
0
    public void OnDeath()
    {
        isDead = true;
        //deathMenu.ToggleEndMenu(score);
        if ((int)PlayerPrefs.GetFloat("Highscore") < score)
        {
            NHS.text = "NEW HIGH SCORE!!";

            PlayerPrefs.SetFloat("Highscore", score);
        }
        deathMenu.ToggleEndMenu(score);
        AddScoreToLeaderBoard(lead, (int)score);
    }
Exemplo n.º 28
0
    void OnTriggerEnter(Collider other)
    {
        /*
         * Player.transform.position = respawnPoint.transform.position;
         * Debug.Log("You die!!"); */

        if (other.gameObject.tag == "Player")
        {
            deathMenu.ToggleEndMenu();
            //Destroy(gameObject);
            Debug.Log("You die! Back to start place!");
            Player.transform.position = respawnPoint.transform.position;
        }
    }
Exemplo n.º 29
0
 private void endGame()
 {
     GameObject.FindGameObjectWithTag("Life" + life).SetActive(false);
     LifeLost[LifeCounter].SetActive(true);
     //GameObject.FindGameObjectWithTag("LifeLost" + life).SetActive(true);
     LifeCounter++;
     life -= 1;
     if (life == 0)
     {
         ended = true;
         speed = 0;
         deathMenu.ToggleEndMenu(Score.GetComponent <ManageScore>().score);
     }
 }
Exemplo n.º 30
0
 public void Death()
 {
     if (!mute)
     {
         orig.Stop();
         slow.Play();
     }
     isDead = true;
     zm.onDead();
     cm.onDead();
     gm.onDead();
     GetComponent <BallMovement>().onDead();
     deathMenu.ToggleEndMenu();
 }