// Use this for initialization
 void Start()
 {
     GetComponent <Rigidbody2D>().AddTorque(-540);
     deleteList     = new HashSet <GameObject> ();
     deleteJewels   = GameObject.Find("Level Controller").GetComponent <RockLevelDeleteJewels> ();
     instantiator   = GameObject.Find("Level Controller").GetComponent <RockLevelInstantiator> ();
     fourInARow     = GameObject.Find("Level Controller").GetComponent <RockLevelFourInARow> ();
     scoreKeeper    = GameObject.Find("Level Controller").GetComponent <RockLevelScoreKeeper> ();
     jewelToDestroy = instantiator.GetJewelGridGameObject(targetJewelRow, targetJewelCol);
     controller     = GameObject.Find("Level Controller").GetComponent <RockLevelController> ();
     audioSources   = GameObject.Find("SoundHandler").GetComponents <AudioSource>();
     soundHandler   = GameObject.Find("Game Manager").GetComponent <SoundHandler> ();
     swapJewel      = GameObject.Find("Level Controller").GetComponent <RockLevelSwapJewel> ();
     if (tag != "End Star")
     {
         instantiatedCrosshairs = (GameObject)Instantiate(crosshairs, new Vector3(-2.45f + (targetJewelCol * .6125f), 2.591252f - (targetJewelRow * .6097268f), -90), Quaternion.identity);
         targetPosition         = instantiatedCrosshairs.transform.position;
     }
     else
     {
         targetPosition = new Vector3(-2.45f + (targetJewelCol * .6125f), 2.591252f - (targetJewelRow * .6097268f), -90);
     }
     timeStamp = Time.time;
     cooldown1 = .25f;
     cooldown2 = .15f;
     if (transform.position.y > -.5)
     {
         oppositeY = Random.Range(4f, 4.5f);
     }
     else
     {
         oppositeY = Random.Range(-4f, -4.65f);
     }
     oppositeX = Random.Range(-2.5f, 2.5f);
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     firstPressed    = null;
     secondPressed   = null;
     tutorial        = true;
     gameStarted     = false;
     cooldown        = 1;
     swapJewels      = gameObject.GetComponent <RockLevelSwapJewel> ();
     checkForMatches = gameObject.GetComponent <RockLevelCheckForMatches> ();
     bombHandler     = gameObject.GetComponent <RockLevelBombHandler> ();
     fiveInARow      = gameObject.GetComponent <RockLevelFiveInARow> ();
     fourInARow      = gameObject.GetComponent <RockLevelFourInARow> ();
     corners         = gameObject.GetComponent <RockLevelCorners> ();
     deleteJewels    = gameObject.GetComponent <RockLevelDeleteJewels> ();
     initialTime     = System.DateTime.Now;
     timeStamp       = Time.time;
     cooldown        = .625f;
     if (GameObject.Find("Mountain Level Two ID") != null)
     {
         tutorialLevel2 = true;
     }
 }
 // Use this for initialization
 void Start()
 {
     rockLevelController = gameObject.GetComponent <RockLevelController> ();
     instantiator        = gameObject.GetComponent <RockLevelInstantiator> ();
     checkForMatches     = rockLevelController.GetComponent <RockLevelCheckForMatches> ();
     instantiator        = rockLevelController.GetComponent <RockLevelInstantiator> ();
     bombHandler         = rockLevelController.GetComponent <RockLevelBombHandler> ();
     starShooter         = gameObject.GetComponent <RockLevelStarShooter> ();
     //		remainderController = levelThreeController.GetComponent<LevelThreeBombRemainderController> ();
     touchHandler    = rockLevelController.GetComponent <RockLevelTouchHandler> ();
     fourInARow      = gameObject.GetComponent <RockLevelFourInARow> ();
     fiveInARow      = gameObject.GetComponent <RockLevelFiveInARow> ();
     corners         = gameObject.GetComponent <RockLevelCorners> ();
     noMatchChecker  = gameObject.GetComponent <RockLevelNoMatchChecker> ();
     shuffle         = gameObject.GetComponent <RockLevelShuffleGameBoard> ();
     soundController = gameObject.GetComponent <SoundController> ();
     deleteJewels    = gameObject.GetComponent <RockLevelDeleteJewels> ();
     if (GameObject.Find("Mountain Level One ID") != null)
     {
         tutorialLevel = true;
     }
 }
    // Use this for initialization
    void Start()
    {
        deleteAgain       = false;
        fourInARow        = false;
        explosionsOn      = true;
        bombNumber        = 8;
        deleteCount       = 0;
        zPosition         = -30;
        deleteListCopy    = new HashSet <GameObject> ();
        boulderDeleteList = new HashSet <GameObject> ();
        floatingJewelList = new HashSet <GameObject> ();
        moveJewelsDown    = gameObject.GetComponent <RockLevelMoveJewelsDown> ();
        instantiator      = gameObject.GetComponent <RockLevelInstantiator> ();
        controller        = gameObject.GetComponent <RockLevelController> ();
        touchHandler      = gameObject.GetComponent <RockLevelTouchHandler> ();
        //		tutorialTouchHandler = gameObject.GetComponent<LevelTwoTutorialTouchHandler> ();
        checkForMatches  = gameObject.GetComponent <RockLevelCheckForMatches> ();
        bombHandler      = gameObject.GetComponent <RockLevelBombHandler> ();
        matchAssistant   = gameObject.GetComponent <RockLevelMatchAssistant> ();
        fourInARowScript = gameObject.GetComponent <RockLevelFourInARow> ();
        //		corners = GameObject.Find ("Level One Controller").GetComponent<LevelOneCorners> ();
        scoreKeeper     = gameObject.GetComponent <RockLevelScoreKeeper> ();
        movementChecker = gameObject.GetComponent <RockLevelMovementChecker> ();
        noMatchChecker  = gameObject.GetComponent <RockLevelNoMatchChecker> ();
        starShooter     = gameObject.GetComponent <RockLevelStarShooter> ();
        if (GameObject.Find("Jewel Collector") != null)
        {
            endOfLevelJewelSprayer = GameObject.Find("Jewel Collector").GetComponent <EndOfLevelCollectionJewelShooter> ();
        }
        soundHandler            = GameObject.Find("Game Manager").GetComponent <SoundHandler> ();
        boulderHolder           = new List <PositionHolder> ();
        targetStaticBlueJewel   = GameObject.Find("Static Jewel Four");
        targetStaticGreenJewel  = GameObject.Find("Static Jewel Three");
        targetStaticOrangeJewel = GameObject.Find("Static Jewel Six");
        targetStaticPurpleJewel = GameObject.Find("Static Jewel Five");
        targetStaticRedJewel    = GameObject.Find("Static Jewel Two");
        targetStaticWhiteJewel  = GameObject.Find("Static Jewel One");

//		if (GameObject.Find ("Time Bomb ID") != null)
//			decreaseBombs = GameObject.Find ("Time Bomb ID").GetComponent<DecreaseBombs> ();
        timeStamp           = Time.time;
        assistanceTimeStamp = Time.time;
        testTimeStamp       = Time.time;
        swapMadeTimestamp   = Time.time;
        swapMadeCoodown     = .1f;
//		okayToMoveTimeStamp = Time.time;
//		okayToMoveCooldown = .1f;
        assistanceCooldown    = 7f;
        powerTrackerTimestamp = Time.time;
        powerTrackerCooldown  = 5;
        cooldown         = 1.5f;
        shadeCount       = 0;
        noMatchCount     = 0;
        deletedPositions = new List <PositionHolder> ();
        if (GameObject.Find("Mountain Level One ID") != null)
        {
            tutorialLevel1 = true;
        }
        else if (GameObject.Find("Mountain Level Two ID") != null)
        {
            tutorialLevel2 = true;
        }
        else if (GameObject.Find("Mountain Level Three ID") != null)
        {
            tutorialLevel3 = true;
        }
        else if (GameObject.Find("Cabin Level Two ID") != null)
        {
            tutorialLevel4 = true;
        }
        startingLeftJewelPosition = -2.415f;
        horizontalMultiplier      = .6125f;
    }