Пример #1
0
 public void handleInput() {
   if (Keys.isPressed(Keys.ESCAPE)) {
     JukeBox.stop("music1");
     gsm.setPaused(true);
   }
   if (blockInput) return;
   if (Keys.isDown(Keys.LEFT)) player.setLeft();
   if (Keys.isDown(Keys.RIGHT)) player.setRight();
   if (Keys.isDown(Keys.UP)) player.setUp();
   if (Keys.isDown(Keys.DOWN)) player.setDown();
   if (Keys.isPressed(Keys.SPACE)) player.setAction();
 }
Пример #2
0
 public void keyReleased(KeyEvent key) {
   Keys.keySet(key.getKeyCode(), false);
 }
Пример #3
0
 public void keyPressed(KeyEvent key) {
   Keys.keySet(key.getKeyCode(), true);
 }
Пример #4
0
 // updates game
 private void update() {
   gsm.update();
   Keys.update();
 }