private void SuperAtaqueFlip(Xbox360GamePad control) { if (CurrentState == VariableState.FlipParado) { if (ListaSuperB[0].getTipo() == "Full") { if (ListaSuperB[0].getCantidadActual() == 100) { if (control.ButtonDown(Xbox360GamePad.Button.B))//if (control.ButtonPushed(Xbox360GamePad.Button.LeftTrigger) && control.ButtonPushed(Xbox360GamePad.Button.RightTrigger)) { ListaSuperB[0].VaciarBarraPorusoFlip(); //hacer super ataque SuperAtaque super = new SuperAtaque(ContentManagerName); super.setPosicion(this.EnemigoX); super.setAnimacion(this.Nombre); ListaAtaqueSuper.Add(super); CurrentState = VariableState.FlipSuper; } } } else if (ListaSuperB[0].getTipo() == "Fraccion") { if (ListaSuperB[0].getCantidadActual() >= 33) { if (control.ButtonDown(Xbox360GamePad.Button.B))//if (control.ButtonPushed(Xbox360GamePad.Button.LeftTrigger) && control.ButtonPushed(Xbox360GamePad.Button.RightTrigger)) { ListaSuperB[0].VaciarBarraPorusoFlip(); //hacer super ataque SuperAtaque super = new SuperAtaque(ContentManagerName); super.setPosicion(this.EnemigoX); super.setAnimacion(this.Nombre); ListaAtaqueSuper.Add(super); CurrentState = VariableState.FlipSuper; } } } } if (CurrentState == VariableState.FlipSuper && this.Sprite.CurrentFrameIndex == 3) { CurrentState = VariableState.FlipParado; } }
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; } }
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; } }
private void BloquearArriba(Xbox360GamePad control) { if (CurrentState == VariableState.Parado || CurrentState == VariableState.Caminando || lastState == VariableState.BloqueoArriba && CurrentState != VariableState.Golpeado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadLeft) && control.ButtonDown(Xbox360GamePad.Button.A)) { this.X = this.X; //AxisAlignedRectangle blq = ShapeManager.AddAxisAlignedRectangle(); this.Shield.ScaleX = this.Sprite.ScaleX * 0.5f; this.Shield.ScaleY = this.Sprite.ScaleY * 0.4f; this.Shield.X = this.X + 100; this.Shield.Y = this.Y; //this.Shield.AttachTo(this.Sprite, true); //ShapeManager.Remove(blq); CurrentState = VariableState.BloqueoArriba; lastState = VariableState.BloqueoArriba; } } else if (lastState == VariableState.BloqueoAbajo || lastState == VariableState.Agachado && CurrentState != VariableState.Golpeado) { if (control.ButtonReleased(Xbox360GamePad.Button.DPadDown) && control.ButtonDown(Xbox360GamePad.Button.DPadLeft) && control.ButtonDown(Xbox360GamePad.Button.A)) { this.Shield.ScaleX = this.Sprite.ScaleX * 0.5f; this.Shield.ScaleY = this.Sprite.ScaleY * 0.4f; this.Shield.X = this.X + 100; this.Shield.Y = this.Y; CurrentState = VariableState.BloqueoArriba; lastState = VariableState.BloqueoArriba; } } }
private void BloquearAbajoFlip(Xbox360GamePad control) { if (CurrentState == VariableState.FlipAgachado || lastState == VariableState.FlipBloqueoAbajo && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadDown) && control.ButtonDown(Xbox360GamePad.Button.A)) { this.Shield.ScaleX = this.Sprite.ScaleX * 0.5f; this.Shield.ScaleY = this.Sprite.ScaleY * 0.4f; this.Shield.X = this.X + 100; this.Shield.Y = this.Y; CurrentState = VariableState.FlipBloqueoAbajo; lastState = VariableState.FlipBloqueoAbajo; } } else if (lastState == VariableState.FlipBloqueoArriba && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonReleased(Xbox360GamePad.Button.DPadRight) && control.ButtonDown(Xbox360GamePad.Button.DPadDown) && control.ButtonDown(Xbox360GamePad.Button.A)) { this.Shield.ScaleX = this.Sprite.ScaleX * 0.5f; this.Shield.ScaleY = this.Sprite.ScaleY * 0.4f; this.Shield.X = this.X + 100; this.Shield.Y = this.Y; CurrentState = VariableState.FlipBloqueoAbajo; lastState = VariableState.FlipBloqueoAbajo; } } else if (lastState == VariableState.FlipCaminando || CurrentState == VariableState.FlipParado && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadDown) && control.ButtonDown(Xbox360GamePad.Button.A)) { this.X = this.X; this.Shield.ScaleX = this.Sprite.ScaleX * 0.5f; this.Shield.ScaleY = this.Sprite.ScaleY * 0.4f; this.Shield.X = this.X + 100; this.Shield.Y = this.Y; CurrentState = VariableState.FlipBloqueoAbajo; lastState = VariableState.FlipBloqueoAbajo; } } }
private void AgacharseFlip(Xbox360GamePad control) { if (this.CurrentState == VariableState.FlipParado || this.lastState == VariableState.FlipCaminando || lastState == VariableState.FlipBloqueoArriba || lastState == VariableState.FlipBloqueoAbajo && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadDown) && !control.AnyButtonPushed()) { this.X = this.X; // this.Shield = null; this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.Cuerpo.Detach(); this.Cuerpo.Y = this.Cuerpo.Y * 2; this.Cuerpo.ScaleY = this.Cuerpo.ScaleY * 0.7f; this.CurrentState = VariableState.FlipAgachado; lastState = VariableState.FlipAgachado; } } }
private void PararseFlip(Xbox360GamePad control) { if (lastState == VariableState.FlipAgachado || lastState == VariableState.FlipBloqueoAbajo && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonReleased(Xbox360GamePad.Button.DPadDown) && !control.ButtonDown(Xbox360GamePad.Button.A)) { //Shield.Detach(); // this.Shield = null; this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.Cuerpo.ScaleY = this.Sprite.ScaleY * 0.5f; //this.Cuerpo.Y = this.Cuerpo.Y/2; this.Cuerpo.Y = this.Sprite.Y; this.Cuerpo.AttachTo(this.Sprite, true); this.CurrentState = VariableState.FlipParado; } } else if (lastState == VariableState.FlipBloqueoArriba && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonReleased(Xbox360GamePad.Button.DPadLeft) || control.ButtonReleased(Xbox360GamePad.Button.A)) { //Shield.Detach(); // this.Shield = null; this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.Cuerpo.ScaleY = this.Sprite.ScaleY * 0.5f; //this.Cuerpo.Y = this.Cuerpo.Y/2; this.Cuerpo.Y = this.Sprite.Y; this.Cuerpo.AttachTo(this.Sprite, true); this.CurrentState = VariableState.FlipParado; } } }
private void SuperAtaque(Xbox360GamePad control) { if (CurrentState == VariableState.Parado) { if (fraccionaria.getCantidadActual() >= 33) { if (control.ButtonDown(Xbox360GamePad.Button.B)) //if (control.ButtonPushed(Xbox360GamePad.Button.LeftTrigger) && control.ButtonPushed(Xbox360GamePad.Button.RightTrigger)) { fraccionaria.VaciarBarraPoruso(); //hacer super ataque SuperAtaque super = new SuperAtaque(ContentManagerName); super.setPosicion(this.EnemigoX); super.setAnimacion(this.Nombre); ListaAtaqueSuper.Add(super); //super.Destroy(); CurrentState = VariableState.Super; } } } if (CurrentState == VariableState.Super && this.Sprite.CurrentFrameIndex == 3) { CurrentState = VariableState.Parado; } }
private void CaminarFlip(Xbox360GamePad control) { if (this.CurrentState == VariableState.FlipParado || lastState == VariableState.FlipCaminando && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadRight)) { this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.X = this.X + this.Velocidad; this.CurrentState = VariableState.FlipCaminando; this.lastState = VariableState.FlipCaminando; } else if (control.ButtonDown(Xbox360GamePad.Button.DPadLeft)) { this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.X = this.X - this.Velocidad; this.CurrentState = VariableState.FlipCaminando; this.lastState = VariableState.FlipCaminando; } } }
private void Caminar(Xbox360GamePad control) { if (this.CurrentState == VariableState.Parado || lastState == VariableState.Caminando && CurrentState != VariableState.Golpeado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadRight))//InputManager.Keyboard.KeyDown(Keys.Right))// { this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.X = this.X + this.Velocidad; this.CurrentState = VariableState.Caminando; this.lastState = VariableState.Caminando; } else if (control.ButtonDown(Xbox360GamePad.Button.DPadLeft)) { this.Shield.ScaleX = 0; this.Shield.ScaleY = 0; this.X = this.X - this.Velocidad; this.CurrentState = VariableState.Caminando; this.lastState = VariableState.Caminando; } } }
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; } }
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 == 0) { Fist1 feto = new Fist1(ContentManagerName); feto.setPosicion(this.X - 30, this.Y + 2, this.EnemigoX); ListaAtaques.Add(feto); //feto.Destroy(); } if (CurrentState == VariableState.FlipEspecial1 && this.Sprite.CurrentFrameIndex == 1) { CurrentState = VariableState.FlipParado; } }
private void AtaqueEspecial2(Xbox360GamePad control) { if (CurrentState == VariableState.Parado) { if (control.ButtonDown(Xbox360GamePad.Button.DPadUp) && control.ButtonPushed(Xbox360GamePad.Button.Y)) { this.CurrentState = VariableState.Especial2; } } if (CurrentState == VariableState.Especial2 && 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.Especial2 && this.Sprite.CurrentFrameIndex == 3) { CurrentState = VariableState.Parado; } }
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(); } }