Exemple #1
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 /*&& CurrentState == VariableState.FlipParado*/ /*&& tiempo % 2 == 0*/)
            {
                if (numero2 <= 10)
                {
                    this.CurrentState = VariableState.FlipEspecial1;
                    Fist1 feto = new Fist1(ContentManagerName);
                    feto.setPosicion(this.X - 100, this.Y + 2, this.EnemigoX);
                    ListaAtaques.Add(feto);
                }

            }

            else if (numero < 50 && CurrentState == VariableState.FlipParado && tiempo % 2 == 0)
            {

                Fisto malnutrido = new Fisto(ContentManagerName);
                malnutrido.setPosicion(this.X, this.Y, this.EnemigoX);
                ListaAtaques.Add(malnutrido);
                this.CurrentState = VariableState.FlipEspecial2;


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

                Fist1 feto = new Fist1(ContentManagerName);
                feto.setPosicion(this.X - 3, this.Y + 2, this.EnemigoX);
                ListaAtaques.Add(feto);
                //feto.Destroy();
            }

            /*else if (CurrentState == VariableState.FlipEspecial2 && this.Sprite.CurrentFrameIndex == 0)
            {

                Fisto malnutrido = new Fisto(ContentManagerName);
                malnutrido.setPosicion(this.X, this.Y, this.EnemigoX);
                ListaAtaques.Add(malnutrido);
                //malnutrido.Destroy();
            }

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

                CurrentState = VariableState.FlipParado;
            }

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

                CurrentState = VariableState.FlipParado;
            }*/

        }
Exemple #2
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 == 0)
            {

                Fisto malnutrido = new Fisto(ContentManagerName);
                malnutrido.setPosicion(this.X-70, this.Y+200, this.EnemigoX);
                ListaAtaques.Add(malnutrido);
                //malnutrido.Destroy();
            }


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

                CurrentState = VariableState.FlipParado;
            }
        }