Exemple #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);
   }
 }
Exemple #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);
   }
 }
 public static void main(String[] args) throws Exception {
   int rc = ToolRunner.run(new Configuration(), new KnownKeysMRv2(), args);
   System.exit(rc);
 }