public Input2D_XBoxController_ThumbStick(PlayerIndex xnaPlayerIndex, int thumbStickIndex) { _XNAPlayerIndex = xnaPlayerIndex; ParentDevice = FRBInput.InputManager.Xbox360GamePads[(int)xnaPlayerIndex]; if (thumbStickIndex > 1) { throw new NotSupportedException("XBox controllers do not have more than 2 thumb sticks."); } ThumbStickIndex = thumbStickIndex; }
public static Xbox360GamePad getControl2() { control2 = InputManager.Xbox360GamePads[1]; return control2; }
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 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 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 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; } } }
public override void ActividadNormal(Xbox360GamePad controln, float x) { setPosicionEnemigo(x); Caminar(controln); Detenerse(controln); Agacharse(controln); Pararse(controln); BloquearArriba(controln); BloquearAbajo(controln); //GolpeArriba(controln); // GolpeBajo(controln); AtaqueEspecial1(controln); AtaqueEspecial2(controln); SuperAtaque(controln); CambiarOrden(controln); AccionarAtaques(); Morir(); }
public bool AsDPadPushedRepeatRate(Xbox360GamePad.DPadDirection direction) { // Ignoring is performed inside this call. return AsDPadPushedRepeatRate(direction, .35, .12); }
public bool AsDPadPushed(Xbox360GamePad.DPadDirection direction) { // If the last was not down and this one is, then report a push. return mLastDPadDown[(int)direction] == false && AsDPadDown(direction); }
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(); } }
void CustomInitialize() { Microsoft.Xna.Framework.Media.MediaPlayer.Play(song); TeamButton.CurrentState = Entities.Button.VariableState.Regular; mGamePad = InputManager.Xbox360GamePads[0]; canMove = true; FlatRedBallServices.Game.IsMouseVisible = true; BackButton.Click += OnBackButtonClick; BackButton.RollOff += OnBackButtonRollOff; BackButton.RollOn += OnBackButtonRollOn; }
void CustomInitialize() { Microsoft.Xna.Framework.Media.MediaPlayer.Play(song); InitializeCustomEvents(); InitializeHeaderText(); FlatRedBallServices.IsWindowsCursorVisible = true; StartButtonInst.Visible = false; NextQuestion.Visible = false; ReadInCSV(); Select3RandomQuestions(); DisplayQuestions(); GamePad = InputManager.Xbox360GamePads[0]; }
public virtual void ActividadFlip(Xbox360GamePad control, float x) { }
private void CambiarOrden(Xbox360GamePad control) { if(control.ButtonPushed(Xbox360GamePad.Button.LeftShoulder)) { this.sensorial.Orden1(); this.PhysDamage = this.PhysDamage * 1.2f; orden2 = false; } else if (control.ButtonPushed(Xbox360GamePad.Button.RightShoulder)) { this.sensorial.Orden2(); this.PhysDamage = auxiliar; orden2 = true; } if (orden2) { if (ListaAtaques.Count > 0) { foreach (Especial i in ListaAtaques) { i.setDamage(20); } } } }
public bool AsDPadPushedRepeatRate(Xbox360GamePad.DPadDirection direction, double timeAfterPush, double timeBetweenRepeating) { if (AsDPadPushed(direction)) return true; // If this method is called multiple times per frame this line // of code guarantees that the user will get true every time until // the next TimeManager.Update (next frame). bool repeatedThisFrame = mLastDPadPush[(int)direction] == TimeManager.CurrentTime; if (repeatedThisFrame || ( AsDPadDown(direction) && TimeManager.CurrentTime - mLastDPadPush[(int)direction] > timeAfterPush && TimeManager.CurrentTime - mLastDPadRepeatRate[(int)direction] > timeBetweenRepeating) ) { mLastDPadRepeatRate[(int)direction] = TimeManager.CurrentTime; return true; } return false; }
public override void ActividadFlip(Xbox360GamePad controln2, float x) { setPosicionEnemigo(x); CaminarFlip(controln2); DetenerseFlip(controln2); AgacharseFlip(controln2); PararseFlip(controln2); BloquearArribaFlip(controln2); BloquearAbajoFlip(controln2); //GolpeArribaFlip(controln2); //GolpeBajoFlip(controln2); AtaqueEspecial1Flip(controln2); AtaqueEspecial2Flip(controln2); SuperAtaqueFlip(controln2); CambiarOrden(controln2); AccionarAtaques(); Morir(); }
public bool AsDPadDown(Xbox360GamePad.DPadDirection direction) { switch (direction) { case Xbox360GamePad.DPadDirection.Left: if (mLastDPadDown[(int)Xbox360GamePad.DPadDirection.Left]) { return mPosition.X < -mDPadOffValue; } else { return mPosition.X < -mDPadOnValue; } //break; case Xbox360GamePad.DPadDirection.Right: if (mLastDPadDown[(int)Xbox360GamePad.DPadDirection.Right]) { return mPosition.X > mDPadOffValue; } else { return mPosition.X > mDPadOnValue; } //break; case Xbox360GamePad.DPadDirection.Up: if (mLastDPadDown[(int)Xbox360GamePad.DPadDirection.Up]) { return mPosition.Y > mDPadOffValue; } else { return mPosition.Y > mDPadOnValue; } //break; case Xbox360GamePad.DPadDirection.Down: if (mLastDPadDown[(int)Xbox360GamePad.DPadDirection.Down]) { return mPosition.Y < -mDPadOffValue; } else { return mPosition.Y < -mDPadOnValue; } //break; default: return false; //break; } }
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; } } }
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 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 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 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 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 == 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 AtaqueEspecial2Flip(Xbox360GamePad control) { if (CurrentState == VariableState.FlipParado) { if (control.ButtonPushed(Xbox360GamePad.Button.LeftShoulder)) { this.CurrentState = VariableState.FlipEspecial2; if (this.Estado == "Natural") { this.Estado = "Bajo"; } else if (this.Estado == "Alto") { this.Estado = "Natural"; } this.interes.setTipo(this.Estado); } else if (control.ButtonPushed(Xbox360GamePad.Button.RightShoulder)) { this.CurrentState = VariableState.FlipEspecial2; if (this.Estado == "Natural") { this.Estado = "Alto"; } else if (this.Estado == "Bajo") { this.Estado = "Natural"; } this.interes.setTipo(this.Estado); } } if (CurrentState == VariableState.FlipEspecial2 && this.Sprite.CurrentFrameIndex == 1) { CurrentState = VariableState.FlipParado; } }
public static Xbox360GamePad getControl1() { control1 = InputManager.Xbox360GamePads[0]; return control1; }
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; } }
protected override void Initialize() { Renderer.UseRenderTargets = false; FlatRedBallServices.InitializeFlatRedBall(this, graphics); CameraSetup.SetupCamera(SpriteManager.Camera); GlobalContent.Initialize(); // Are there any gamepads connected? if (FlatRedBall.Input.InputManager.Xbox360GamePads[0].IsConnected == false) { FlatRedBall.Input.InputManager.Xbox360GamePads[0].CreateDefaultButtonMap(); } GamePad = InputManager.Xbox360GamePads[0]; Screens.ScreenManager.Start(typeof(BeefBall.Screens.MainMenu).FullName); base.Initialize(); FlatRedBallServices.GraphicsOptions.UseMultiSampling = false; FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point; StartGameSFX = Content.Load<SoundEffect>("StartSound"); BeepSFX = Content.Load<SoundEffect>("beep"); Levels = new List<string>(); Levels.Add(typeof(BeefBall.Screens.GameScreen).FullName); Levels.Add(typeof(BeefBall.Screens.GameScreenCopy).FullName); }
void CustomInitialize() { SpriteManager.Camera.X = 50; SpriteManager.Camera.Y = 40; Microsoft.Xna.Framework.Media.MediaPlayer.Play(song); StartGameButton.CurrentState = Entities.Button.VariableState.Regular; mGamePad = InputManager.Xbox360GamePads[0]; canMove = true; FlatRedBallServices.Game.IsMouseVisible = true; }