Beispiel #1
0
    Text text;                      // Reference to the Text component.

    // Use this for initialization
    void Start()
    {
        // Set up the reference.
        lvl   = GameObject.Find("_SCRIPTS_").GetComponent <levelControl>();
        score = 0;

        text         = GetComponent <Text> ();
        newHighScore = false;
    }
Beispiel #2
0
    // prevent 'double loading' bug and initialise levelcontrol management
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        sceneIndex  = SceneManager.GetActiveScene().buildIndex;
        levelPassed = PlayerPrefs.GetInt("LevelPassed");
    }
Beispiel #3
0
    void Awake()
    {
        //finds out what level we're at and sees if its a new level or not
        lvl = GameObject.Find("_SCRIPTS_").GetComponent <levelControl>();
        string temp    = lvl.sceneName;
        string trimmed = temp.TrimStart("world".ToCharArray());

        string[] levelArr = trimmed.Split('-');
        string   world    = levelArr [0];
        string   level    = levelArr [1];

        index = ((int.Parse(world) - 1) * 8 + (int.Parse(level) - 1));
        if (HiScoreScript.hScoreScript.highScoreArr [index] == 0)
        {
            newLevel = true;
        }
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     lvl = GameObject.Find("_SCRIPTS_").GetComponent <levelControl>();
 }
Beispiel #5
0
    void Awake()
    {
        DontDestroyOnLoad(this);
        objCount = 0;
        objNum   = 0;


        ScoreChecker.firstObj  = false;
        ScoreChecker.secondObj = false;
        ScoreChecker.thirdObj  = false;

        try{
            lvl = GameObject.Find("_SCRIPTS_").GetComponent <levelControl>();
            string   temp     = lvl.sceneName;
            string   trimmed  = temp.TrimStart("world".ToCharArray());
            string[] levelArr = trimmed.Split('-');
            string   world    = levelArr [0];
            string   level    = levelArr [1];
            index = ((int.Parse(world) - 1) * 8 + (int.Parse(level) - 1));
            hits  = levelControl.hitString;
            touch = levelControl.touchString;
            //Debug.Log("WORKED: "+index);
            int index2 = index;
        }catch (Exception e) {
            Debug.Log("Caught Exceptiong: " + e);
        }

        //sets up the string to be displayed
        //Debug.Log("INDEX: " + index);
        switch (index)
        {
        case 0:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Hit 4 Targets";
            ScoreChecker.obj3string = "Miss no more than 5 times";
            break;

        case 1:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Hit 2 targets from High Angle";
            ScoreChecker.obj3string = "Hit 2 cars in a row";
            break;

        case 2:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Hit 4 objects thrown at you";
            ScoreChecker.obj3string = "Never touch the ceiling";
            break;

        case 3:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Only hit birds";
            ScoreChecker.obj3string = "Stay under half the screen for 5 seconds";
            break;

        case 4:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Hit vehicles only";
            ScoreChecker.obj3string = "Hit the motorcycle";
            break;

        case 5:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Hit 2 civilians";
            ScoreChecker.obj3string = "Dodge all objects thrown at you";
            break;

        case 6:
            ScoreChecker.obj1string = "Get a score 5 or Higher!";
            ScoreChecker.obj2string = "Don't get hit for 45 seconds";
            ScoreChecker.obj3string = "Never touch the ceiling";
            break;

        case 7:
            ScoreChecker.obj1string = "Get a score 15 or Higher!";
            ScoreChecker.obj2string = "Hit 3 birds";
            ScoreChecker.obj3string = "Hit the yellow buggy!";
            break;

        case 99:
            ScoreChecker.obj1string = "DON'T";
            ScoreChecker.obj2string = "STOP";
            ScoreChecker.obj3string = "BELIEVINNNN'";
            break;
        }
    }