private void UpdateKeyPress(KeyboardState keystate_now) { if (!isAutoReversed && ((game.twoButtonMode && (!JoyStick.KEY(5) || JoyStick.IsOnKeyUp(5))) || (!game.twoButtonMode && (!JoyStick.KEY(2) || JoyStick.IsOnKeyUp(2))))) //自動発動でなければ { isReversed = false; } }
protected override void ButtonUpdate() { base.ButtonUpdate(); if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { if (game.isHighLvl) { game.hasReachedCheckPoint = false; } game.isHighLvl = false; if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } PushScene(new AvilitySelect(this)); } if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.isHighLvl) { game.hasReachedCheckPoint = false; } game.isHighLvl = true; if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } PushScene(new AvilitySelect(this)); } }
public override void Update(double dt) { if (counter < logoDisplayTime) { if (JoyStick.IsOnKeyDown(8) || JoyStick.IsOnKeyDown(1)) { SkipLogo(); } } else { if (counter == logoDisplayTime) { if (!game.isMuted) { SoundControl.Play(); } hasDisplayed = true; } #if DEBUG Debug(); #endif if (JoyStick.IsOnKeyDown(8) || JoyStick.IsOnKeyDown(1)) { PushScene(new MainMenu(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } counter = 0; } } counter++; }
public override void Update(double dt) { if (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8)) // To Next Stage { if (game.stageNum < Game1.maxStageNum) { game.stageNum++; game.hasReachedCheckPoint = false; SoundControl.Stop(); game.ReloadStage(game.isHighLvl); //SoundControl.Pause();//SoundControl.Stop(); isEndScene = true; upperScene.isEndScene = true; } else if (game.stageNum == Game1.maxStageNum && (form.IsDisposed || form == null)) // To Ending { game.stageNum = 1; game.hasReachedCheckPoint = false; SoundControl.Stop(); PushScene(new Ending(this, true)); } } counter++; }
protected override void ButtonUpdate() { if (button[0].isSelected && (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8))) // Continue { SoundControl.Stop(); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } //SoundControl.Pause();//SoundControl.Stop(); //isEndScene = true; nowLoading = true; } if (button[1].isSelected && (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8))) // Back to Menu { if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } SoundControl.Stop(); SoundControl.IniMusic("Audio\\BGM\\menu_new", true); //isEndScene = true; //BackScene(game.stageNum + 4);//5 game.hasReachedCheckPoint = false; game.tmpGameStatus = new GameStatus(); game.InitializeStack(); } if ((!game.twoButtonMode && JoyStick.KEY(2) || game.twoButtonMode && JoyStick.KEY(5)) && game.avilityNum == 0) { if ((upperScene as Stage).reverse.ReduceTAS() != 0) { SoundControl.Stop(); SoundControl.RestoreMusic(); SoundControl.Resume(); if (!game.isMuted) { (upperScene as Stage).reverse.PlaySound(); } isEndScene = true; (upperScene as Stage).player.isAlive = true; (upperScene as Stage).toGameOver = false; (upperScene as Stage).hasEffectedPlayerDeath = false; (upperScene as Stage).reverse.StartReverse(); (upperScene as Stage).ResetDeathEffect(); } } if (hasDisplayed) { game.ReloadStage(game.isHighLvl); isEndScene = true; } }
protected virtual void ButtonUpdate() { if (JoyStick.IsOnKeyDown(3) || JoyStick.IsOnKeyDown(2)) { isEndScene = true; if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } } }
protected override void ButtonUpdate() { base.ButtonUpdate(); if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } isEndScene = true; } }
/// <summary> /// 決定/戻るボタンの設定はそのまま、 /// 各項目を設定する状態に入った後の入力をゲーム中のそれぞれの操作に割り当てる /// </summary> protected override void ButtonUpdate() { base.ButtonUpdate(); if (!waitingInput) { if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { // crossのconfig処理 waitingInput = true; if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) { // leftButtonのconfig処理 if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) { isEndScene = true; if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } } else { if (JoyStick.curButtons.Count > 0) { if (button[0].isSelected) { JoyStick.keyMap[2] = JoyStick.curButtons[0]; waitingInput = false; } else if (button[1].isSelected) { JoyStick.keyMap[5] = JoyStick.curButtons[0]; waitingInput = false; } } } }
protected override void ButtonUpdate() { base.ButtonUpdate(); if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) // reverse { if (!game.isMuted) { start.Play(SoundControl.volumeAll, 0f, 0f); } //game.stageNum = 1; // StageSelectでstageNumを変えるため game.avilityNum = 0; SoundControl.Stop(); nowLoading = true; //game.ReloadStage(game.isHighLvl); //PushStage(); } if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) // slow { if (!game.isMuted) { start.Play(SoundControl.volumeAll, 0f, 0f); } //game.stageNum = 1; game.avilityNum = 1; SoundControl.Stop(); nowLoading = true; //PushStage(); //PushScene(new Stage1(this, game.isHighLvl)); } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) // accel { if (!game.isMuted) { start.Play(SoundControl.volumeAll, 0f, 0f); } //game.stageNum = 1; game.avilityNum = 2; nowLoading = true; SoundControl.Stop(); //PushStage(); //PushScene(new Stage1(this, game.isHighLvl)); } if (hasDisplayed) { PushStage(); } }
public override void Update(double dt) { if (JoyStick.IsOnKeyDown(2) || JoyStick.IsOnKeyDown(3)) { isEndScene = true; } if (JoyStick.IsOnKeyDown(1)) { page++; if (page >= pageNum) { page = pageNum - 1; isEndScene = true; } } }
public override void Draw(SpriteBatch spriteBatch) { // 文字列幅or高さの取得はfontArial.MeasureString if (counter < logoDisplayTime) { if (counter < logoDisplayTime / 3.0) // 40 { if (counter % 2 == 0) { dColor += .05f; } } if (counter >= logoDisplayTime / 3.0 && counter < logoDisplayTime * 2 / 3.0) //65 { dColor = 1f; //d = 180; } if (counter >= logoDisplayTime * 3 / 4.0 && counter < logoDisplayTime) // 80 { if (counter % 2 == 0) { dColor += -.05f; } } spriteBatch.Draw(texture[1], Vector2.Zero, Color.White); spriteBatch.Draw(texture[2], Vector2.Zero, Color.White * dColor); //new Color(255, 255, 255, dColor } else { if (JoyStick.IsOnKeyDown(2) || JoyStick.IsOnKeyDown(3)) { BackToLogo(); } if (counter % 5 == 0) { e += .02f; //if (d >= 360) e = 0; } dColor = (float)Math.Sin(e * 8) / 2.0f + 0.5f; spriteBatch.Draw(texture[0], Vector2.Zero, Color.White); spriteBatch.Draw(texture[3], Vector2.Zero, Color.White * dColor); } }
protected override void ButtonUpdate() { base.ButtonUpdate(); if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { game.stageNum = 1; PushScene(new LvlSelect(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) { game.stageNum = 2; PushScene(new LvlSelect(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) { game.stageNum = 3; PushScene(new LvlSelect(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[3].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } isEndScene = true; } }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) { this.Exit(); } // TODO: Add your update logic here //JoyStick.Update(1); JoyStick.Update(1); KeyInput.Update(); if (KeyInput.KEY(Keys.Escape) || KeyInput.IsOnKeyDown(Keys.Escape)) { Exit(); } dt = gameTime.ElapsedGameTime.TotalSeconds; currentScene = scenes.Peek(); while (currentScene.isEndScene) { scenes.Pop(); if (scenes.Count > 0) { currentScene = scenes.Peek(); } else { this.Exit(); break; } } if (scenes.Count > 0) { currentScene.Update(gameTime.ElapsedGameTime.TotalSeconds); } else { this.Exit(); } base.Update(gameTime); }
public override void Update(double dt) { if (!timer.IsStarted) { timer.Start(); } if (timer.TotalTime() > (float)timings.Last() || JoyStick.IsOnKeyDown(1)) { SoundControl.Stop(); SoundControl.IniMusic("Audio\\BGM\\menu_new", true); //BackScene(5); if (fromGame) { game.InitializeStack(); //BackScene(8); } else { isEndScene = true; } } }
protected override void ButtonUpdate() { if (JoyStick.IsOnKeyDown(2) || JoyStick.IsOnKeyDown(3)) { isEndScene = true; if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } SoundControl.Stop(); SoundControl.IniMusic("Audio\\BGM\\menu_new", true); } if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { PushScene(new LvlSelect(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) { PushScene(new Tutorial(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) { PushScene(new Option(this)); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } }
protected override void ButtonUpdate() { /*if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { // KeyConfig * game.PushScene(new KeyConfig(this)); * if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f); * }*/ if (!isEndScene && SoundControl.musicInstance.State == SoundState.Stopped) { SoundControl.IniMusic("Audio\\BGM\\menu-b", true); SoundControl.Play(); } if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) // FullScreen / Window { if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } game.graphics.ToggleFullScreen(); } if (button[1].isSelected && JoyStick.onStickDirectionChanged) // Volume Control { if (JoyStick.stickDirection == Direction.RIGHT && SoundControl.volumeAll <= .95f) { game.wholeVolume = SoundControl.volumeAll += .05f; SoundControl.musicInstance.Volume += .05f; } else if (JoyStick.stickDirection == Direction.LEFT && SoundControl.volumeAll >= 0.05f) { game.wholeVolume = SoundControl.volumeAll -= .05f; SoundControl.musicInstance.Volume -= .05f; } } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) // Mute { if (game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); // ここだけはわかりやすさのため他のSEの条件の逆にする } if (!game.isMuted) { game.isMuted = true; SoundControl.Stop(); } else { game.isMuted = false; SoundControl.Play(); } } if (button[3].isSelected && JoyStick.IsOnKeyDown(1)) // Sound Test { if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } PushScene(new SoundTest(this)); } if (button[4].isSelected && JoyStick.IsOnKeyDown(1)) // Ranking { if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } PushScene(new Ranking(this)); } if (button[5].isSelected && JoyStick.IsOnKeyDown(1)) // StageSelect { if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } PushScene(new StageSelect(this)); } if (button[6].isSelected && JoyStick.IsOnKeyDown(1)) // Credit { SoundControl.Stop(); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } PushScene(new Ending(this, false)); } if (button[7].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.twoButtonMode) { game.twoButtonMode = true; } else { game.twoButtonMode = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[8].isSelected && JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(3)) // Back To Menu { if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } isEndScene = true; SoundControl.Stop(); if (upperScene is MainMenu) { SoundControl.IniMusic("Audio\\BGM\\menu_new", true); SoundControl.Play(); } } }
protected override void ButtonUpdate() { base.ButtonUpdate(); if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } isEndScene = true; } if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.inDebugMode) { game.inDebugMode = true; } else { game.inDebugMode = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.isMuted) { game.isMuted = true; } else { game.isMuted = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[3].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.visibleSword) { game.visibleSword = true; } else { game.visibleSword = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } /*if (button[4].isSelected && JoyStick.IsOnKeyDown(1)) { * if (!game.visibleScore) game.visibleScore = true; * else game.visibleScore = false; * * if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f); * }*/ if (button[4].isSelected && JoyStick.IsOnKeyDown(1)) { if (!stage.player.syouryuuMode) { stage.player.syouryuuMode = true; } else { stage.player.syouryuuMode = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[5].isSelected && JoyStick.IsOnKeyDown(1)) { if (!stage.player.thrustChargeMode) { stage.player.thrustChargeMode = true; } else { stage.player.thrustChargeMode = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } if (button[6].isSelected && JoyStick.IsOnKeyDown(1)) { if (!game.twoButtonMode) { game.twoButtonMode = true; } else { game.twoButtonMode = false; } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } }
protected override void ButtonUpdate() { /*if () { * isEndScene = true; * if (!game.isMuted) cancel.Play(SoundControl.volumeAll, 0f, 0f); * }*/ // BGM if (button[0].isSelected && JoyStick.onStickDirectionChanged) // BGM { if (JoyStick.stickDirection == Direction.RIGHT) { if (musicIndex < musics.Length - 1) { musicIndex++; } } else if (JoyStick.stickDirection == Direction.LEFT) { if (musicIndex > 0) { musicIndex--; } } } if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) { SoundControl.Stop(); musicInstance.Stop(); musicInstance = musics[musicIndex].CreateInstance(); musicInstance.Volume = musicVolume; musicInstance.Play(); } if (button[1].isSelected && JoyStick.onStickDirectionChanged) // BGM volume { if (JoyStick.stickDirection == Direction.RIGHT && musicVolume <= 0.95f) { musicVolume += .05f; } else if (JoyStick.stickDirection == Direction.LEFT && musicVolume >= 0.05f) { musicVolume -= .05f; } } // SE if (button[2].isSelected && JoyStick.onStickDirectionChanged) // SE { if (JoyStick.stickDirection == Direction.RIGHT) { if (seIndex < soundEffects.Length - 1) { seIndex++; } } else if (JoyStick.stickDirection == Direction.LEFT) { if (seIndex > 0) { seIndex--; } } } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) { SoundControl.Stop(); seInstance.Stop(); seInstance = soundEffects[seIndex].CreateInstance(); seInstance.Volume = seVolume; seInstance.Play(); } if (button[3].isSelected && JoyStick.onStickDirectionChanged) // SE volume { if (JoyStick.stickDirection == Direction.RIGHT && seVolume <= 0.95f) { seVolume += .05f; } else if (JoyStick.stickDirection == Direction.LEFT && seVolume >= 0.05f) { seVolume -= .05f; } } if (button[4].isSelected && JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(3) || JoyStick.IsOnKeyDown(2)) // Back { musicInstance.Stop(); seInstance.Stop(); SoundControl.Stop(); if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } isEndScene = true; SoundControl.IniMusic("Audio\\BGM\\menu-b", true); SoundControl.Play(); } }
protected override void ButtonUpdate() { if (JoyStick.IsOnKeyDown(3) || JoyStick.IsOnKeyDown(8)) { isEndScene = true; if (!game.isMuted) { cancel.Play(SoundControl.volumeAll, 0f, 0f); } } if (KeyInput.IsOnKeyDown(Microsoft.Xna.Framework.Input.Keys.T)) { if (!game.inDebugMode) { game.inDebugMode = true; } else if (game.inDebugMode) { game.inDebugMode = false; } } if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) // Resume { isEndScene = true; (upperScene as Stage).isPausing = false; if (!game.isMuted) { SoundControl.Resume(); } if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } /*if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) { // Option * PushScene(new Option(this)); * if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f); * }*/ if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) // to Menu { if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } SoundControl.IniMusic("Audio\\BGM\\menu_new", true); if (!game.isMuted) { SoundControl.Play(); } BackScene(4); } if (button[2].isSelected && JoyStick.IsOnKeyDown(1)) // to DebugMenu { PushScene(new DebugMenu(this, (upperScene as Stage))); if (!game.isMuted) { choose.Play(SoundControl.volumeAll, 0f, 0f); } } /*if (button[3].isSelected && JoyStick.IsOnKeyDown(1)) { // Exit * game.Exit(); * if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f); * }*/ }