Exemplo n.º 1
0
 public void keyPressed(int key, char c) {
   if (key == Input.KEY_DOWN) {
     for (int i = 0; i < 4; ++i) {
       if (hovering[i]) {
         hovering[i] = false;
         hovering[i + 1] = true;
         break;
       }
     }
     hovering[0] = true;
   } else if (key == Input.KEY_UP) {
     for (int i = 0; i < 4; ++i) {
       if (hovering[i]) {
         hovering[i] = false;
         hovering[i - 1] = true;
         break;
       }
     }
     hovering[0] = true;
   } else if (key == Input.KEY_ENTER) {
     if (hovering[0]) Demigods.enterMenuState(Demigods.PLAYER_SELECT_SCREEN);
     else if (hovering[1]) return; // No settings menu yet
     else if (hovering[2]) System.exit(0);
   }
 }
Exemplo n.º 2
0
 public void mouseReleased(int button, int x, int y) {
   if (button == 0) {
     if (x > 455 && x < 600 && y > 260 && y < 300)
       Demigods.enterMenuState(Demigods.PLAYER_SELECT_SCREEN);
     else if (x > 380 && x < 675 && y > 320 && y < 360) return; // No Settings menu yet
     else if (x > 455 && x < 600 && y > 380 && y < 420) System.exit(0);
   }
 }
Exemplo n.º 3
0
 /** @see org.newdawn.slick.BasicGame#keyPressed(int, char) */
 public void keyPressed(int key, char c) {
   if (key == Input.KEY_ESCAPE) {
     System.exit(0);
   }
   if (key == Input.KEY_F1) {
     if (app != null) {
       try {
         app.setDisplayMode(600, 600, false);
         app.reinit();
       } catch (Exception e) {
         Log.error(e);
       }
     }
   }
 }