Beispiel #1
0
 @Override
 public void keyPressed(int key, char c) {
   switch (key) {
     case Input.KEY_ESCAPE:
     case Input.KEY_Q:
       ((ButtonMenu) game.getState(Opsu.STATE_BUTTONMENU)).setMenuState(MenuState.EXIT);
       game.enterState(Opsu.STATE_BUTTONMENU);
       break;
     case Input.KEY_P:
       SoundController.playSound(SoundEffect.MENUHIT);
       if (!logoClicked) {
         logoClicked = true;
         logoTimer = 0;
         playButton.getImage().setAlpha(0f);
         exitButton.getImage().setAlpha(0f);
       } else enterSongMenu();
       break;
     case Input.KEY_D:
       SoundController.playSound(SoundEffect.MENUHIT);
       game.enterState(
           Opsu.STATE_DOWNLOADSMENU,
           new FadeOutTransition(Color.black),
           new FadeInTransition(Color.black));
       break;
     case Input.KEY_R:
       nextTrack();
       break;
     case Input.KEY_UP:
       UI.changeVolume(1);
       break;
     case Input.KEY_DOWN:
       UI.changeVolume(-1);
       break;
     case Input.KEY_F7:
       Options.setNextFPS(container);
       break;
     case Input.KEY_F10:
       Options.toggleMouseDisabled();
       break;
     case Input.KEY_F12:
       Utils.takeScreenShot();
       break;
   }
 }
Beispiel #2
0
 /**
  * Processes a mouse wheel movement.
  *
  * @param container the game container
  * @param game the game
  * @param newValue the amount that the mouse wheel moved
  */
 public void scroll(GameContainer container, StateBasedGame game, int newValue) {
   UI.changeVolume((newValue < 0) ? -1 : 1);
 }
Beispiel #3
0
 @Override
 public void mouseWheelMoved(int newValue) {
   UI.changeVolume((newValue < 0) ? -1 : 1);
 }