示例#1
0
 public void Pay()
 {
     if (PlayGlobalVariables.experience >= 7000)
     {
         if ((PlayGlobalVariables.money - PlayGlobalVariables.experience) < 0)
         {
             ship.GoToWorld1();
             Close();
         }
         else
         {
             PlayGlobalVariables.reduceMoney(7000);
             ship.GoToWorld1();
             Close();
         }
     }
     else if (PlayGlobalVariables.money >= 7000)
     {
         PlayGlobalVariables.reduceMoney(7000);
         ship.GoToWorld1();
         Close();
     }
     else
     {
         text.text = "You don't have enough money ";
     }
 }
示例#2
0
    public void EnterCheatCode()
    {
        string strCheat = inputCheat.text.ToLower();

        if (strCheat.Equals("money100"))
        {
            PlayGlobalVariables.addMoney(100);
        }
        else if (strCheat.Equals("money1000"))
        {
            PlayGlobalVariables.addMoney(1000);
        }
        else if (strCheat.Equals("money2000"))
        {
            PlayGlobalVariables.addMoney(2000);
        }
        else if (strCheat.Equals("debt100"))
        {
            PlayGlobalVariables.reduceMoney(100);
        }
        else if (strCheat.Equals("xdebt100"))
        {
            PlayGlobalVariables.reduceMoneyAndExperience(100);
        }

        inputCheat.text = "";
    }
示例#3
0
 public void clickThis()
 {
     if (int.TryParse(text.text, out decoy))
     {
         int n = int.Parse(text.text);
         PlayGlobalVariables.addMoney(n);
         Application.LoadLevel(level);
     }
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        audioSource = GetComponent <AudioSource>();

        if (isMusic)
        {
            audioSource.volume = PlayGlobalVariables.getMusicVolume();
        }
        else
        {
            audioSource.volume = PlayGlobalVariables.getEffectsVolume();
        }
    }
示例#5
0
    public void gameOver(int score)
    {
        if (PlayGlobalVariables.hasEnoughExperience(requiredExp) == false)
        {
            if (score <= 0)
            {
                mainText.text = "Game Over. Please practice more";
                score         = 0;
            }
            else if (score <= 2)
            {
                mainText.text = "You could do better. Practice more";
            }
            else if (score <= 3)
            {
                mainText.text = "Not bad. A little practice can help";
            }
            else if (score == 4)
            {
                mainText.text = "Almost perfect. Great job";
            }
            else
            {
                mainText.text = "Perfect!";
            }

            int earned = score * 200;

            money.text = "" + earned;
            PlayGlobalVariables.addMoney(earned);
        }
        else
        {
            mainText.text = "You have enough experience.";
            money.text    = "0";
        }

        ShopGlobals.running = false;
        stopGame();
        GetComponent <Animator> ().SetBool("active", true);
    }
示例#6
0
 public void Pay2()
 {
     if (PlayGlobalVariables.experience >= 14000)
     {
         if (((PlayGlobalVariables.money + 7000) - PlayGlobalVariables.experience) < 0)
         {
             Application.LoadLevel(20);
         }
         else
         {
             PlayGlobalVariables.reduceMoney(7000);
             Application.LoadLevel(20);
         }
     }
     if (PlayGlobalVariables.money >= 7000)
     {
         PlayGlobalVariables.reduceMoney(7000);
         Application.LoadLevel(21);
     }
     else
     {
         text.text = "You don't have enough money ";
     }
 }