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(); }
public void keyReleased(KeyEvent key) { Keys.keySet(key.getKeyCode(), false); }
public void keyPressed(KeyEvent key) { Keys.keySet(key.getKeyCode(), true); }
// updates game private void update() { gsm.update(); Keys.update(); }