Exemple #1
0
        private void AtaqueEspecial1Flip(Xbox360GamePad control)
        {
            if (CurrentState == VariableState.FlipParado)
            {
                if (control.ButtonDown(Xbox360GamePad.Button.DPadUp) && control.ButtonPushed(Xbox360GamePad.Button.X))
                {
                    
                    //proyectil.Destroy();
                    this.CurrentState = VariableState.FlipEspecial1;

                }

            }

            if (CurrentState == VariableState.FlipEspecial1 && this.Sprite.CurrentFrameIndex == 2)
            {

                Proyectil proyectil = new Proyectil(ContentManagerName);
                proyectil.setPosicion(this.X - 50, this.Y, this.EnemigoX);
                proyectil.setTipo(this.Estado);
                this.ListaAtaques.Add(proyectil);
            }

            if (CurrentState == VariableState.FlipEspecial1 && this.Sprite.CurrentFrameIndex == 3)
            {

                CurrentState = VariableState.FlipParado;
            }
        }
Exemple #2
0
        private void AtacarAI()
        {
            Random random = new Random();
            double numero = random.NextDouble() * 100;
            double numero2 = random.NextDouble() * 100;
            double tiempo = TimeManager.CurrentTime +3;
            if (numero >= 50)
            {
                if (numero2 < 10)
                {
                    //proyectil.Destroy();
                    Proyectil proyectil = new Proyectil(ContentManagerName);
                    proyectil.setPosicion(this.X - 50, this.Y, this.EnemigoX);
                    proyectil.setTipo(this.Estado);
                    this.ListaAtaques.Add(proyectil);
                    this.CurrentState = VariableState.FlipEspecial1;

                }
            }

           /* if (CurrentState == VariableState.FlipEspecial1 && this.Sprite.CurrentFrameIndex == 1)
            {

                Proyectil proyectil = new Proyectil(ContentManagerName);
                proyectil.setPosicion(this.X - 50, this.Y, this.EnemigoX);
                proyectil.setTipo(this.Estado);
                this.ListaAtaques.Add(proyectil);
            }  */

            if (CurrentState == VariableState.FlipEspecial1 && this.Sprite.CurrentFrameIndex == 2)
            {

                CurrentState = VariableState.FlipParado;
            }           

        }