Пример #1
0
        private void AtaqueEspecial2Flip(Xbox360GamePad control)
        {
            if (CurrentState == VariableState.FlipParado)
            {
                if (control.ButtonDown(Xbox360GamePad.Button.DPadUp) && control.ButtonPushed(Xbox360GamePad.Button.Y))
                {
                    

                    this.CurrentState = VariableState.FlipEspecial2;

                }


            }

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

                //for (int i = 0; i > 3; i++)
               // {
                    Precios precio = new Precios(ContentManagerName);
                    precio.setPosicion(this.X - 2 , this.Y + 100, this.EnemigoX, this.Y);
                    this.ListaAtaques.Add(precio);
                    // precio.Destroy();

                //}
            }


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

                CurrentState = VariableState.FlipParado;
            }
        }
Пример #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 >= 90 )
            {

                if (numero2 < 1)
                {    //proyectil.Destroy();
                    Proyectil proyectil = new Proyectil(ContentManagerName);
                    proyectil.setPosicion(this.X - 50, this.Y, this.EnemigoX);
                    proyectil.setTipo(this.Estado);
                    this.CurrentState = VariableState.FlipEspecial1;
                }

            }*/

            if (numero < 10 )
            {
                if (numero2 > 90)
                {
                    Precios precio = new Precios(ContentManagerName);
                    precio.setPosicion(this.X - 2, this.Y + 100, this.EnemigoX, this.Y);
                    this.ListaAtaques.Add(precio);
                    this.CurrentState = VariableState.FlipEspecial2;
                }
            }

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

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

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

                for (int i = 0; i > 3; i++)
                {
                    Precios precio = new Precios(ContentManagerName);
                    precio.setPosicion(this.X - 2 * i, this.Y + 5, this.EnemigoX, this.Y);
                    this.ListaAtaques.Add(precio);
                    // precio.Destroy();

                }
            }*/

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

                CurrentState = VariableState.FlipParado;
            }

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

                CurrentState = VariableState.FlipParado;
            }*/
            
            this.sensorial.Orden2();
                
                
            
                if (ListaAtaques.Count > 0)
                {
                    foreach (Especial i in ListaAtaques)
                    {
                        i.setDamage(20);

                    }
                }
        }