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 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 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 DetenerseFlip(Xbox360GamePad control) { if (this.lastState == VariableState.FlipCaminando && CurrentState != VariableState.FlipGolpeado) { if (control.ButtonReleased(Xbox360GamePad.Button.DPadRight) || control.ButtonReleased(Xbox360GamePad.Button.DPadLeft)) { this.X = this.X; this.CurrentState = VariableState.FlipParado; } } }