public void Update(GameTime gametime) { if (!titleSelect.GetStarted) { //keyの変更とpadの対応 By張ユービン 10/26 //keyの変更 By葉梨竜太 11/30 if (inputState.CheckTriggerKey(Parameter.MenuKey, Parameter.JumpButton) || inputState.IsKeyDown(Keys.Z) || inputState.IsKeyDown(Keys.Space)) { //Startを表示するから、他の選択肢の表示を移す titleSelect.GetStarted = true; sound.PlaySE("decision1"); //by 柏 2016.12.14 選択のSEを追加 } } else { //keyの変更とpadの対応 By張ユービン 10/26 //keyの変更 By葉梨竜太 11/30 if (inputState.CheckTriggerKey(Parameter.MenuKey, Parameter.JumpButton) || inputState.IsKeyDown(Keys.Z) || inputState.IsKeyDown(Keys.Space)) { isEnd = true; } } titleSelect.Update(); }
public void Update() { Flash(); if (isClear) //clear状態だけ選択有効 { if (inputState.CheckTriggerKey(Keys.Up, Buttons.LeftThumbstickUp)) { sound.PlaySE("cursor"); //by 柏 2016.12.14 SE実装 if (player.IsDead || (!player.IsDead && isPause)) { if (select == 1) { return; } } else { if (select == 0) { return; } } select--; } else if (inputState.CheckTriggerKey(Keys.Down, Buttons.LeftThumbstickDown)) { sound.PlaySE("cursor"); //by 柏 2016.12.14 SE実装 if (select == 2) { return; } select++; } //選択確定 //keyの変更 By葉梨竜太 11/30 else if (inputState.CheckTriggerKey(Parameter.MenuKey, Parameter.JumpButton) || inputState.IsKeyDown(Keys.Z) || inputState.IsKeyDown(Keys.Space)) { isEnd = true; } } }
/// <summary> /// 火を投げる /// </summary> private void ThrowFire() { if (fireNum > 1) { //inputState.IsKeyDown(Keys.X) if (inputState.CheckTriggerKey(Parameter.ThrowKey, Parameter.ThrowButton)) { Vector2 firePos = Vector2.Zero; Vector2 fireVelo = Vector2.Zero; Fire fire = new Fire(firePos, fireVelo); //投げ出した火の位置と速度を計算(初期位置は自身とぶつからないように) if (diretion == Direction.UP) { fireVelo = new Vector2(0, -1f); firePos = new Vector2(position.X + ColRect.Width / 2 - fire.ColRect.Width / 2, position.Y - fire.ColRect.Height); } else if (diretion == Direction.LEFT) { fireVelo = new Vector2(-1f, -2f); firePos = new Vector2(position.X - fire.ColRect.Width / 2, position.Y - fire.ColRect.Height); } else if (diretion == Direction.RIGHT) { fireVelo = new Vector2(1f, -2f); firePos = new Vector2(position.X + ColRect.Width - fire.ColRect.Width / 2, position.Y - fire.ColRect.Height); } fireVelo.Normalize(); fireVelo *= Parameter.FireSpeed; fire.Position = firePos; fire.Velocity = fireVelo + velocity; firesList.Insert(0, fire); fireNum--; } } }
public void Update(GameTime gametime) { if (!titleSelect.GetStarted) { //keyの変更とpadの対応 By氷見悠人 10/26 if (inputState.CheckTriggerKey(Parameter.MenuKey, Parameter.MenuButton)) { //Startを表示するから、他の選択肢の表示を移す titleSelect.GetStarted = true; } } else { //keyの変更とpadの対応 By氷見悠人 10/26 if (inputState.CheckTriggerKey(Parameter.MenuKey, Parameter.MenuButton)) { isEnd = true; } } titleSelect.Update(); }
public void Update() { if (isClear) //clear状態だけ選択有効 { if (inputState.CheckTriggerKey(Keys.Up, Buttons.LeftThumbstickUp)) { if (player.IsDead) { if (select == 1) { return; } } else { if (select == 0) { return; } } select--; } else if (inputState.CheckTriggerKey(Keys.Down, Buttons.LeftThumbstickDown)) { if (select == 2) { return; } select++; } //選択確定 else if (inputState.CheckTriggerKey(Parameter.MenuKey, Parameter.JumpButton)) { isEnd = true; } } }
/// <summary> /// 火を投げる /// </summary> private void ThrowFire() { //投げ出した火の位置と速度を計算(初期位置は自身とぶつからないように) //Speedを固定にした //上下左右にした isthrow = true; if (diretion == Direction.UP || inputState.CheckDownKey(Keys.Up, Buttons.LeftThumbstickUp)) { aim = new Vector2(0, -Parameter.FireSpeed); aimpos = new Vector2(position.X, position.Y - 48); } else if (diretion == Direction.DOWN || inputState.CheckDownKey(Keys.Down, Buttons.LeftThumbstickDown)) { aim = new Vector2(0, Parameter.FireSpeed); aimpos = new Vector2(position.X, position.Y + 60); isthrow = isOnGround ? false : true; } else if (diretion == Direction.LEFT || inputState.CheckDownKey(Keys.Left, Buttons.LeftThumbstickLeft)) { aim = new Vector2(-Parameter.FireSpeed, 0); aimpos = new Vector2(position.X - 50, position.Y); } else if (diretion == Direction.RIGHT || inputState.CheckDownKey(Keys.Right, Buttons.LeftThumbstickRight)) { aim = new Vector2(Parameter.FireSpeed, 0); aimpos = new Vector2(position.X + 50, position.Y); } if (fireNum > 0) { if (inputState.CheckTriggerKey(Parameter.ThrowKey, Parameter.ThrowButton)) { if (isthrow) { Vector2 fireVelo = aim; Vector2 firePos = aimpos; Fire fire = new Fire(firePos, fireVelo, watersList); //葉梨竜太 //単位ベクトル化 fireVelo.Normalize(); fire.Velocity = fireVelo * Parameter.FireSpeed; //葉梨竜太 fire.SetStartPos(); firesList.Insert(0, fire); fireNum--; } //投げる状態に入る animePlayer.PlayAnimation(throwAnime); playerMotion = PlayerMotion.THROW; sound.PlaySE("fire1"); } aim.Normalize(); aimpos.X = aimpos.X + (Parameter.FireFly * 64 * aim.X); aimpos.Y = aimpos.Y + (Parameter.FireFly * 64 * aim.Y); AimCheck(); } }