public void generalConstructor() { //This calls every variable that can be changed from the difficulty setting for every type //of block (boss and regular) newVariables(GameControllerScript.attackRate, GameControllerScript.growRate, GameControllerScript.regularDamage, GameControllerScript.blockHealth, GameControllerScript.bossAttack); //Spawnrate if they ever need it spawnRate = Random.Range(2, 5); //Rigid body rb2d = GetComponent <Rigidbody2D>(); //Makes it so the boss stays in one spot if (tag == "Block") { rb2d.AddForce(new Vector3(Random.Range(-25f, 25f), Random.Range(-25f, 25f), 0)); } //Places blocks in arraylist thisBlock = this; blockList.Add(thisBlock); //Color and renderers rend = gameObject.GetComponent <SpriteRenderer>(); col = rend.material.color; red = 0; frozen = false; currentTime = Time.time; nextHealth = currentTime + 1.5; //Size variables transform.localScale = new Vector3(0, 0, 0); maxSize = new Vector3(60, 60, 0); //Block health variables maxHealth = health; healthRate = 2.5; clickedOn = false; //Boss Variables textHealth = new GameObject(); textHealth.AddComponent <TextMesh>(); //showHealth(); }
public void generalConstructor() { //This calls every variable that can be changed from the difficulty setting for every type //of block (boss and regular) newVariables(GameControllerScript.attackRate, GameControllerScript.growRate, GameControllerScript.regularDamage, GameControllerScript.blockHealth, GameControllerScript.bossAttack); //Spawnrate if they ever need it spawnRate = Random.Range(2, 5); //Rigid body rb2d = GetComponent<Rigidbody2D>(); //Makes it so the boss stays in one spot if (tag == "Block") { rb2d.AddForce(new Vector3(Random.Range(-25f, 25f), Random.Range(-25f, 25f), 0)); } //Places blocks in arraylist thisBlock = this; blockList.Add(thisBlock); //Color and renderers rend = gameObject.GetComponent<SpriteRenderer>(); col = rend.material.color; red = 0; frozen = false; currentTime = Time.time; nextHealth = currentTime + 1.5; //Size variables transform.localScale = new Vector3(0, 0, 0); maxSize = new Vector3(60, 60, 0); //Block health variables maxHealth = health; healthRate = 2.5; clickedOn = false; //Boss Variables textHealth = new GameObject(); textHealth.AddComponent<TextMesh>(); //showHealth(); }