예제 #1
0
    ///***********************************************************************
    /// Here can increase gameSpeed and decrease itemCloneInterval values to
    /// make the game harder.
    ///***********************************************************************

    void modifyLevelDifficulty()
    {
        levelPassedTime = Time.timeSinceLevelLoad;
        if (levelPassedTime > levelStartTime + levelJump)
        {
            //increase level difficulty (but limit it to a maximum level of 10)
            if (currentLevel < 10)
            {
                currentLevel += 1;

                //let the player know what happened to him/her
                playSfx(levelAdvanceSfx);

                //clone items faster
                //cloneInterval -= 0.2f; //very important!!!
                //cloneInterval--;
                print("cloneInterval: " + cloneInterval);

                if (cloneInterval < 0.3f)
                {
                    cloneInterval = 0.3f;
                }

                levelStartTime += levelJump;

                //Background color correction (fade to red)
                float colorCorrection = currentLevel / 10.0f;
                print("colorCorrection: " + colorCorrection);
                mainBackground.GetComponent <Renderer>().material.color = new Color(1, 1 - colorCorrection, 1 - colorCorrection);
            }
        }
    }
예제 #2
0
 public void TakeLife()
 {
     lives--;
     if (lives <= 0)
     {
         pause.SetActive(false);
         lives = 0;
         GameController.gameOver = true;
     }
 }