Ejemplo n.º 1
0
 //Inicializacion de componentes
 void Start()
 {
     tipo          = GetComponent <TipoEnemigo>();
     enemyMovement = GetComponent <EnemyMovement>();
     enemyMovement.CambiarDireccion(puntos[i % puntos.Length]);
     Physics2D.queriesStartInColliders = false;
 }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        TipoEnemigo enemy = other.gameObject.GetComponent <TipoEnemigo>();

        if (enemy && enemy.TipoDeEnemigo() == Disfraz.guardia)
        {
            Destroy(this.gameObject, tiempoVida);
        }
    }
Ejemplo n.º 3
0
 public void CambiarTipoEnemigo(TipoEnemigo tipo)
 {
     if (transform.childCount != 0)
     {
         if (transform.GetChild(0).GetComponent <NPC>() != null)
         {
             transform.GetChild(0).GetComponent <NPC>().tipoEnemigo = tipo;
         }
     }
 }
Ejemplo n.º 4
0
        private void addWolfy(object sender, EventArgs e)
        {
            this.currentStatus = AppState.AddingEnemy;
            tipoEnemigo        = TipoEnemigo.Wolfy;

            this.flechaToolStripButton.Checked = false;
            this.vampyToolStripButton.Checked  = false;
            //this.fantyToolStripButton.Checked = false;
            this.frankyToolStripButton.Checked = false;
            this.coinToolStripButton.Checked   = false;
            uncheckPlatforms();
        }
Ejemplo n.º 5
0
        public IEnemigo CrearEnemigo(TipoEnemigo tipo)
        {
            switch (tipo)
            {
            case TipoEnemigo.Mago:
                return(new Mago());

            case TipoEnemigo.Ninja:
                return(new Ninja());

            case TipoEnemigo.Samurai:
                return(new Samurai());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 6
0
 private void Start()
 {
     movEnemigo  = GetComponentInParent <MovimientoEnemigo>();
     tipoEnemigo = GetComponentInParent <TipoEnemigo>();
 }
Ejemplo n.º 7
0
 private void Start()
 {
     TipoEnemigo = enemyGO.GetComponent <TipoEnemigo>();
     enemyMov    = gameObject.GetComponentInParent <MoveEnemy>();
     render      = GetComponent <SpriteRenderer>();
 }
Ejemplo n.º 8
0
        private void addWolfy(object sender, EventArgs e)
        {
            this.currentStatus = AppState.AddingEnemy;
            tipoEnemigo = TipoEnemigo.Wolfy;

            this.flechaToolStripButton.Checked = false;
            this.vampyToolStripButton.Checked = false;
            //this.fantyToolStripButton.Checked = false;
            this.frankyToolStripButton.Checked = false;
            this.coinToolStripButton.Checked = false;
            uncheckPlatforms();
        }