// Use this for initialization
 void Start()
 {
     scoreControllerRef = GameObject.Find ("scoreP").GetComponent<scoreController> ();
     speed = Random.Range (6f, 10f);
     time =Random.Range(0.2f,0.5f);
     player = GameObject.FindGameObjectWithTag("Player");
 }
	// Use this for initialization
	void Start () {
		theSpawnDoor = GameObject.Find ("winningConditions").GetComponent <spawnDoor> ();

		Time.timeScale = 1;
		thePlayerScore = GameObject.Find("_GM").GetComponent<scoreController> ();
		thePlayerHealth = GameObject.Find("Player").GetComponent <playerHealth> ();
	}
Example #3
0
    public void resumeOrTryAction()
    {
        uiSound();

        GameObject      gameControllerObject = GameObject.FindWithTag("GameController");
        scoreController score = gameControllerObject.GetComponent <scoreController>();

        if (score != null)
        {
            if (score.getScore() == 0)
            {
                showSelectLevel();
                return;
            }
            if (score.getHealth() > 0)
            {
                resumeGame();
            }
            else
            {
                adTryAgain = true;
                showAd();
            }
        }
    }
Example #4
0
    public void loadLevel(int level)
    {
        hideMenu();
        Cursor.visible = false;
        Time.timeScale = 1;

        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            scoreController score = gameControllerObject.GetComponent <scoreController>();
            if (score != null)
            {
                score.updateLevelText(level);
                score.resetStars();
                score.resetScore();
                score.resetHealth();
            }
        }

        SceneManager.LoadScene(0);

        GameObject gameEngine = GameObject.Find("GameEngine");
        gameEngine engine     = gameEngine.GetComponent <gameEngine>();

        engine.startLevel(level, false);
    }
    // Use this for initialization
    void Start()
    {
        sc = GameObject.Find("_GM").GetComponent <scoreController> ();
        //Debug.Log ("win stage = "+sc.winStage1);

        /*PlayerPrefs.DeleteKey ("winStage1");
         * sc.winStage1 = 0;*/
    }
Example #6
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
Example #7
0
    public void tryAgain()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            scoreController score = gameControllerObject.GetComponent <scoreController>();
            if (score != null)
            {
                loadLevel(score.getLevel());
            }
        }
    }
Example #8
0
    // Use this for initialization
    void Start()
    {
        myRigidbody = GetComponent <Rigidbody2D>();

        myCollider = GetComponent <BoxCollider2D>();

        myCircleCollider = GetComponent <CircleCollider2D>();

        myAnimator = GetComponent <Animator>();

        obstacleCtrl = GameObject.FindObjectOfType <obstacleController>();

        theScoreController = FindObjectOfType <scoreController>();
    }
Example #9
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        randomPositionXStar = Random.Range(-2500, -2600);
    }
Example #10
0
    public void makeDead()
    {
        Instantiate(deathFX, transform.position, transform.rotation);
        Destroy(gameObject);
        AudioSource.PlayClipAtPoint(playerDeathSound, transform.position);
        damageScreen.color = damagedColour;
        pauseBtn.SetActive(false);
        scoreController thePlayerScore = GameObject.Find("_GM").GetComponent <scoreController> ();

        txtScoreDeath.text = thePlayerScore.Score.ToString();
        Animator gameOverAnimator = playerDeathUI.GetComponent <Animator> ();

        gameOverAnimator.SetTrigger("gameOver");
        //theGameManager.restartTheGame ();
    }
Example #11
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        StartCoroutine("AutoBulletProcess");
        player = GameObject.FindGameObjectWithTag("Player");
    }
Example #12
0
 // Use this for initialization
 void Start()
 {
     //GetComponent<Rigidbody2D>().velocity = movement;
     GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
     if (gameControllerObject != null)
     {
         score = gameControllerObject.GetComponent <scoreController>();
     }
     if (score == null)
     {
         Debug.Log ("Cannot find 'GameController' script");
     }
     GameObject player = GameObject.FindGameObjectWithTag ("Player");
     playerLocation = player.transform.position;
     //GetComponent<Rigidbody2D>().AddForce ((player.transform.position - transform.position).normalized * Time.smoothDeltaTime * 350);
 }
Example #13
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        float randomPositionXStar = Random.Range(-2500, -2600);
        float randomPositionYStar = this.gameObject.transform.position.y;

        destination = new Vector2(randomPositionXStar, randomPositionYStar);
    }
Example #14
0
    // Use this for initialization
    void Start()
    {
        //InvokeRepeating ("launchBullet", 1f, 1f);
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        randomPositionYStar = Random.Range(-300, 300);
        randomPositionXStar = Random.Range(-500, 1200);
    }
Example #15
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        GameObject menuControls = GameObject.Find("menuControls");

        menu = menuControls.GetComponent <startOver>();
        menu.startScreen();
    }
Example #16
0
    void Start()
    {
        GameObject puppyShip = GameObject.Find("puppyShip");
        GameObject craftShip = GameObject.Find("craftShip");

        puppyShip.SetActive(false);
        craftShip.SetActive(true);

        starCenter = GameObject.FindWithTag("starCenter");

        Cursor.visible = false;
        //Screen.lockCursor = true;
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        GameObject menu = GameObject.FindGameObjectWithTag("menu");

        menuCanvas         = menu.GetComponent <Canvas>();
        menuCanvas.enabled = false;

        foreach (Transform child in transform)
        {
            Debug.Log(child.gameObject.name);
            if (child.gameObject.name.Equals("bombDropLocation"))
            {
                bombDropLocation = child.gameObject.transform;
            }
        }



        StartCoroutine(AutoBulletProcess());
        StartCoroutine(AutoSpecialBulletProcess());
        oneFourth = Screen.width / 4;
        oneHalf   = Screen.width / 2;
    }
Example #17
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        randomPositionYStar = Random.Range(-1600, 2000);
        randomPositionXStar = Random.Range(-2500, -2600);
        GameObject bossGameObject = GameObject.FindWithTag("bossBubble");

        if (bossGameObject != null)
        {
            this.transform.parent = bossGameObject.transform;
        }
        player = GameObject.FindGameObjectWithTag("Player");
    }
Example #18
0
    public void resumeOrTryText()
    {
        GameObject      gameControllerObject = GameObject.FindWithTag("GameController");
        scoreController score = gameControllerObject.GetComponent <scoreController>();

        GameObject resumeTextGameObject = GameObject.FindWithTag("resumeOrTryAgain");
        Text       textObj = resumeTextGameObject.GetComponent <Text>();

        if (score != null)
        {
            if (score.getHealth() > 0)
            {
                textObj.text = "RESUME";
            }
            else
            {
                textObj.text = "TRY AGAIN";
            }
            if (score.getScore() == 0)
            {
                textObj.text = "NEW GAME";
            }
        }
    }
Example #19
0
    //public static string inGameName;

    void start()
    {
        theScoreController = FindObjectOfType <scoreController>();
    }
 // Use this for initialization
 void Start()
 {
     GameObject scoreControllerObject = GameObject.FindGameObjectWithTag("score");
             Initalize ();
      scoreController = scoreControllerObject.GetComponent<scoreController>();
             //startPos = gameObject.transform.position;
 }
Example #21
0
    void addScore()
    {
        scoreController thePlayerScore = GameObject.Find("_GM").GetComponent <scoreController> ();

        thePlayerScore.addScore(enemyScore);
    }
Example #22
0
 // Use this for initialization
 void Start()
 {
     score = GetComponent<Text>();
     GameObject scoreControllerObject = GameObject.FindGameObjectWithTag("score");
     scoreController = scoreControllerObject.GetComponent<scoreController>();
 }
 void Start()
 {
     txt = GetComponent<TextMesh> ();
     scriptRef = GameObject.Find ("scoreP").GetComponent<scoreController> ();
 }
 // Use this for initialization
 void Start()
 {
     score = GameObject.FindGameObjectWithTag ("score").GetComponent<scoreController>();
     contadores = Camera.main.GetComponent<Contadores> ();
     waves = GameObject.Find ("SpawnBoss").GetComponent<spawnBoss> ();
     DamageReducion = false;
     maxHitPoints = hitPoints;
     anim = GameObject.FindGameObjectWithTag("Face").GetComponent<Animator>();
     damageSFX.volume = PlayerPrefs.GetFloat("SFXVolume");
 }
Example #25
0
 void start()
 {
     theScoreController          = FindObjectOfType <scoreController>();
     theScoreController.scoreInc = true;
 }