Exemple #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)
            {

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


            if (CurrentState == VariableState.FlipEspecial2 && 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 < 8 )
            {
                if (numero2 > 90)
                {
                    Fetoyectil feto = new Fetoyectil(ContentManagerName);
                    feto.setPosicion(this.X - 3, this.Y + 2, this.EnemigoX);
                    ListaAtaques.Add(feto);
                    //feto.Destroy();
                    poblacion.UpdateFillFlip();
                    this.CurrentState = VariableState.FlipEspecial1;
                }

            }

            else if (numero > 90)
            {

                if (numero2 < 5)
                {
                    Malnutrido malnutrido = new Malnutrido(ContentManagerName);
                    malnutrido.setPosicion(this.X, this.Y, this.EnemigoX);
                    ListaAtaques.Add(malnutrido);
                    //malnutrido.Destroy();
                    poblacion.UpdateFillFlip();
                    this.CurrentState = VariableState.FlipEspecial2;
                }
            }

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

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

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

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

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

                CurrentState = VariableState.FlipParado;
            }

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

                CurrentState = VariableState.FlipParado;
            }*/

        }