示例#1
0
 // Use this for initialization
 void Start()
 {
     //folderpath = "MondrianArtPuzzle_Data/";
     InputTeam.onValueChanged.AddListener(delegate {
         DisableIsCheck();
     });
     ischecked        = false;
     solutionaccepted = false;
     isproceed        = false;
     checkstarted     = false;
     indexarea        = 0;
     selisih          = 0;
     max            = 0;
     min            = 0;
     textscore.text = "SCORE : -";
     timer          = 420.0f;
     used           = new Vector2[2000];//perbaiki
     usedindex      = 0;
     submitted      = false;
     dc             = GameObject.Find("DiffSave").GetComponent <DifficultyChosen> ();
     size           = dc.size;
     for (int i = 0; i < scoringarray.Length; i++)
     {
         if (size == scoringarray [i].x)
         {
             textgoal.text   = "GOAL : SCORE <= " + scoringarray [i].y;
             textrecord.text = "WORLD RECORD : " + scoringarray [i].z;
             goalsc          = (int)scoringarray [i].y;
             worldrec        = (int)scoringarray [i].z;
         }
     }
     SetGameFrames(size);
 }
    // take in difficulty change
    void DifficultyChanged()
    {
        Debug.Log(difficultySlider.value);
        this.difficultyLevel = (int)(difficultySlider.value);

        // call the static method to set the level
        DifficultyChosen.setDifficultyLevel(this.difficultyLevel);
    }
示例#3
0
    //function to set the event probability based on the player's chosen difficulty
    //Outcome addressed: Difficulty management
    void setProbabilities()
    {
        //get the difficulty from a script that preserves the data from the starting scene
        int difficulty = DifficultyChosen.getDifficultyLevel();

        //set the probability based on the difficulty number: the more difficult, the higher is the event probability
        switch (difficulty)
        {
        case 0:
            normalProbability       = 20;
            supernaturalProbability = 25;
            break;

        case 1:
            normalProbability       = 30;
            supernaturalProbability = 35;
            break;

        case 2:
            normalProbability       = 35;
            supernaturalProbability = 60;
            break;
        }
    }
示例#4
0
    //private Vector2 moveforce;
    //private Vector2 rotateforce;

    //private Rigidbody2D camrb;

    void Start()
    {
        dc = GameObject.Find("DiffSave").GetComponent <DifficultyChosen> ();
        //camrb = cam.GetComponent<Rigidbody2D> ();
    }