// Start is called before the first frame update void Start() { planetBarName = planetBar.name; bar = GameObject.Find(planetBarName).GetComponent <PlanetHealthBar>(); player = GameObject.Find("Player"); hp = player.GetComponent <Health>(); powerups = player.GetComponent <Powerups>(); planetName = gameObject.name; }
// Start is called before the first frame update void Start() { sr = GetComponent <SpriteRenderer>(); cC2D = GetComponent <CircleCollider2D>(); player = GameObject.Find("Player"); powerups = player.GetComponent <Powerups>(); sr.enabled = false; notDamaged = true; }
void Start() { player = GameObject.Find("Player"); powerups = player.GetComponent <Powerups>(); speed = GameObject.Find("Speed POW"); triBullet = GameObject.Find("Tri POW"); bigBullet = GameObject.Find("BigBullet POW"); shield = GameObject.Find("Shield POW"); }
// Start is called before the first frame update void Start() { //Gets player states p = GetComponent <playerStates>(); leftFace = GameObject.Find("LeftFacing"); rightFace = GameObject.Find("RightFacing"); p.lookingLeft = false; player = GameObject.Find("Player"); powerups = player.GetComponent <Powerups>(); }
void Start() { anim = GetComponent <Animator>(); powerups = GameObject.Find("Player").GetComponent <Powerups>(); finishedAnimation = false; int RNG = Random.Range(1, 5); //From the RNG, set the waypoints and the name of the planet if (RNG == 1 && !powerups.purplePlanetisDestroyed) { Wpoints = GameObject.FindGameObjectWithTag("WayPointPurple").GetComponent <Waypoints>(); planetName = "purplePlanet"; } else if (RNG == 2 && !powerups.redPlanetisDestroyed) { Wpoints = GameObject.FindGameObjectWithTag("WayPointRed").GetComponent <Waypoints>(); planetName = "redPlanet"; } else if (RNG == 3 && !powerups.earthisDestroyed) { Wpoints = GameObject.FindGameObjectWithTag("WayPointEarth").GetComponent <Waypoints>(); planetName = "earth"; } else if (RNG == 4 && !powerups.orangePlanetisDestroyed) { Wpoints = GameObject.FindGameObjectWithTag("WayPointOrange").GetComponent <Waypoints>(); planetName = "orangePlanet"; } else { Start(); } planet = GameObject.Find(planetName); pHP = planet.GetComponent <planetHealth>(); }
private void Start() { body = GetComponent <Rigidbody2D>(); player = GameObject.Find("Player"); powerups = player.GetComponent <Powerups>(); }