示例#1
0
    public void OnTriggerEnter(Collider coll)
    {
        GameObject other = coll.gameObject.transform.root.gameObject;

        if (other.tag == "Projectile")
        {
            Projectile_Manager p = other.gameObject.GetComponent <Projectile_Manager>();
            p.ParticlesOnDeath();
            health -= p.damageOnHit * damageMultiplier;
            Instantiate(p.effect, gameObject.transform);
            Destroy(other.gameObject);
        }
        if (other.tag == "Waypoint")
        {
            other = coll.gameObject.transform.parent.gameObject;
            nav.SetWaypoint(other.gameObject.GetComponent <Waypoint>().nextWaypoint);
        }
        else if (other.tag == "EndPoint")
        {
            mana.currentMana -= 2 * health;
            textyPoo.AddText("-2" + (2 * health));
            other = coll.gameObject;
            nav.SetWaypoint(nav.firstWaypoint);
            gameObject.transform.position = nav.spawnPos;
        }
        else if (other.tag == "Tower")
        {
            if (!other.GetComponent <Tower_Manager>().beingBlocked)
            {
                StartCoroutine(ApproachTower(other.gameObject));
            }
        }
    }
示例#2
0
 public void GetViewPort(Viewport viewPort)
 {
     Collision_Manager.GetViewPort(viewPort);
     Asteroid_Manager.GetViewPort(viewPort);
     Ship_Manager.GetViewPort(viewPort);
     Projectile_Manager.GetViewPort(viewPort);
 }
示例#3
0
 public void DrawGameScreen(SpriteBatch spriteBatch)
 {
     Asteroid_Manager.Draw(spriteBatch);
     PowerUp_Manager.Draw(spriteBatch);
     Ship_Manager.Draw(spriteBatch);
     Projectile_Manager.Draw(spriteBatch);
     Explosions.Draw(spriteBatch);
     HUD.Draw(spriteBatch);
 }
示例#4
0
        public void UpdateGameScreen(GameTime gameTime, bool otherScreenHasFocus)
        {
            if (otherScreenHasFocus)
            {
                return;
            }

            Collision_Manager.Update(gameTime);
            Asteroid_Manager.Update(gameTime);
            Ship_Manager.Update(gameTime);
            Projectile_Manager.Update(gameTime);
            PowerUp_Manager.Update(gameTime);
            Explosions.Update(gameTime);
            GameOver_Manager.Update(gameTime);
        }
示例#5
0
    public void OnTriggerEnter(Collider coll)
    {
        GameObject other = coll.gameObject.transform.root.gameObject;

        if (other.tag == "Projectile")
        {
            Projectile_Manager p = other.gameObject.GetComponent <Projectile_Manager>();
            p.ParticlesOnDeath();
            health -= p.damageOnHit * damageMultiplier;
            Instantiate(p.effect, gameObject.transform);
            Destroy(other.gameObject);
        }
        else if (other.tag == "Waypoint")
        {
            other = coll.gameObject.transform.parent.gameObject;
            nav.SetWaypoint(other.gameObject.GetComponent <Waypoint>().nextWaypoint);
        }
        else if (other.tag == "EndPoint")
        {
            mana.currentMana -= 2 * health;
            textyPoo.AddText("-2" + (2 * health));
            other = coll.gameObject;
            nav.SetWaypoint(nav.firstWaypoint);
            gameObject.transform.position = nav.spawnPos;
        }
        else if (other.tag == "Tower")
        {
            // don't blow up if tower is already disabled
            if (!other.gameObject.GetComponent <Tower_Manager>().canFire)
            {
                return;
            }
            // decide whether or not to blow up. For our purposes, we will go boom immeadiately
            // also fire off the bomber particle effect
            StartCoroutine("bomberSequence", other.gameObject);
        }
    }