示例#1
0
    public void Killed()
    {
        // If the game is paused, then player should not be killed
        if (pause == true)
        {
            Instantiate(this.Player, new Vector3(0, -9, 0), Quaternion.AngleAxis(180, Vector3.up));
        }

        else
        {
            // If the player is out of lives
            if (lives == 0)
            {
                // Display the leaderboard
                gameoverScript.Display2(true, Score);
            }
            else
            {
                // Take a life away
                lives--;

                // Update life text
                liveCount.text = "Lives Left: " + lives;

                // Create a new instance of the player
                Instantiate(this.Player, new Vector3(0, -9, 0), Quaternion.AngleAxis(180, Vector3.up));
            }
        }
    }
示例#2
0
 public void Killed()
 {
     // If the player is out of lives
     if (lives == 0)
     {
         // Display the leaderboard
         gameoverScript.Display2(true, Score);
     }
     else
     {
         print(ballCount);
         ballCount--;
         if (ballCount == 0)
         {
             // Take a life away
             lives--;
             liveCount.text = "Lives Left: " + lives;
             if (powerType == 2)
             {
                 large.dead();
                 ballCount = 1;
             }
             else if (powerType == 3)
             {
                 ball.dead();
                 clone1.dead();
                 clone2.dead();
                 ballCount = 3;
             }
             else
             {
                 ball.dead();
                 ballCount = 1;
             }
         }
     }
 }