Beispiel #1
0
        private void AtaqueEspecial1(Xbox360GamePad control)
        {
            if (CurrentState == VariableState.Parado)
            {
                if (control.ButtonDown(Xbox360GamePad.Button.DPadUp) && control.ButtonPushed(Xbox360GamePad.Button.X))
                {
                    
                    this.CurrentState = VariableState.Especial1;
                    Fetoyectil feto = new Fetoyectil(ContentManagerName);
                    //feto.X = this.X;
                    //feto.Y = this.Y;
                    feto.setPosicion(this.X + 3,this.Y + 2, this.EnemigoX);
                    ListaAtaques.Add(feto);
                    //feto.Destroy();
                    poblacion.UpdateFillFlip();
                }

            }

            if (CurrentState == VariableState.Especial1 && this.Sprite.CurrentFrameIndex == 1)
            {
                //Fetoyectil feto = new Fetoyectil(ContentManagerName);
               // feto.setPosicion(400/*this.X + 3*/, -120/*this.Y + 2*/, this.EnemigoX);
                //ListaAtaques.Add(feto);
                //feto.Destroy();
               // poblacion.UpdateFillFlip();
               
            }

            
        }
Beispiel #2
0
        private void AtaqueEspecial1Flip(Xbox360GamePad control)
        {
            if (CurrentState == VariableState.FlipParado)
            {
                if (control.ButtonDown(Xbox360GamePad.Button.DPadUp) && control.ButtonPushed(Xbox360GamePad.Button.X))
                {
                    
                    this.CurrentState = VariableState.FlipEspecial1;

                }

            }

            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();
            }

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

                CurrentState = VariableState.FlipParado;
            }
        }
Beispiel #3
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;
            }*/

        }