Ejemplo n.º 1
0
 // 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;
 }
Ejemplo n.º 2
0
 // 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;
 }
Ejemplo n.º 3
0
 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");
 }
Ejemplo n.º 4
0
        // 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>();
        }
Ejemplo n.º 5
0
        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>();
        }
Ejemplo n.º 6
0
 private void Start()
 {
     body     = GetComponent <Rigidbody2D>();
     player   = GameObject.Find("Player");
     powerups = player.GetComponent <Powerups>();
 }