Ejemplo n.º 1
0
    void checkDead()
    {
        if (life < 1)
        {
            //enable gravity and disable user control
            flyMovement.enabled = false;
            rb.useGravity       = true;

            //when the player loses all three lifes, the game-over sound is played.
            source.clip = gameOverSound;
            source.Play();

            //play falling animation
            anim.Play("falling");
            gameOver.enabled = true;
            Time.timeScale   = 0f;           //Stop the game

            //Check if the time is less than 30 seconds, give achievement
            if (time <= 30)
            {
                achievement_Wipeout.enabled = true;
                wipeout = true;
            }

            //Check if the owl is carry more than 3 pieces of mail, give achievement
            mailCount    = GetComponent <MailCount>();
            carryingMail = mailCount.returnMail();
            if (carryingMail >= 3)
            {
                achievement_Pressure.enabled = true;
                pressure = true;
            }
        }
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     flymovement = GetComponent <FlyMovement> ();
     mailcount   = GetComponent <MailCount> ();
     collision   = GetComponent <Collision> ();
     rb          = GetComponent <Rigidbody> ();
     anim        = GetComponent <Animation> ();
     radar       = radarCam.GetComponent <Radar> ();
     started     = false;
     beforeStart();
 }