Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        enemySnake = Camera.main.GetComponent <spawnEnemy>();

        xPos = this.gameObject.transform.position.x;
        yPos = this.gameObject.transform.position.y;

        timer = timerMax;
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();

        if (SceneManager.GetActiveScene().name == "Level2" || SceneManager.GetActiveScene().name == "Level3")
        {
            enemySpawner = Camera.main.GetComponent <spawnEnemy>();
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     Instance      = this;
     player        = GameObject.FindWithTag("Player").transform;
     realTimer     = timerSet;
     realLTimer    = LtimerSet;
     realBossTimer = bossTimerSet;
     //adding lieutenant Spawn points to an array
     lieutenantPoints [0] = lieutenantSpawn1;
     lieutenantPoints [1] = lieutenantSpawn2;
     lieutenantPoints [2] = lieutenantSpawn3;
     lieutenantPoints [3] = lieutenantSpawn4;
     lieutenantPoints [4] = lieutenantSpawn5;
     lieutenantPoints [5] = lieutenantSpawn6;
 }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        mat = Resources.Load <Material>("Material/PathMat");

        inGamePathLine          = this.gameObject.GetComponent <LineRenderer>();
        inGamePathLine.material = mat;



        AnimationCurve curve = new AnimationCurve();

        curve.AddKey(0.0f, 0.3f);
        inGamePathLine.widthCurve = curve;

        if (SceneManager.GetActiveScene().name == "Level2")
        {
            inGamePathLine.startColor = new Color32(240, 255, 0, 100);
            inGamePathLine.endColor   = new Color32(199, 207, 36, 100);
        }

        currentTarget = 1;

        Debug.Log(this.name);

        //the instance of the seeker attached to this game object
        seeker = GetComponent <Seeker>();

        enemySnake = Camera.main.GetComponent <spawnEnemy>();


        tailsize = enemySnake.snakeLength;

        targets = GameObject.FindGameObjectsWithTag("Player");
        target  = targets[0];

        //generate the initial path
        pathToFollow = seeker.StartPath(transform.position, target.transform.position);


        //move the red robot towards the green enemy
        StartCoroutine(moveTowardsTarget(this.transform));
    }
Ejemplo n.º 5
0
    void Start()
    {
        //gameOver = false;
        restart           = false;
        gameOverText.text = "";
        restartText.text  = "";
        manaOverText.text = "";
        quoteText.text    = "";

        score = 0;
        DisplayScore();
        StartCoroutine(SpawnWaves());

        GameObject gameManager = GameObject.FindGameObjectWithTag("SlimeSpawner");

        spawnEnemies = gameManager.GetComponent <spawnEnemy>();

        if (null == spawnEnemies)
        {
            Debug.Log("spawnEnemies null GameController");
        }
    }