@Override public void controlPressed(Command command) { LOGGER.debug("com.jed.state.PlayState#controlPressed"); LOGGER.info("controlPressed {}",command.toString()); if(command.equals(new BasicCommand("pauseToggle"))) { paused = !paused; } else if(command.equals(new BasicCommand("stepFrame"))) { if (paused) { stepFrame = true; } } else if(command.getName().equals(BasicCommandConstants.JUMP)) { currentMap.getPlayer().setJumping(true); } else if(command.getName().equals(BasicCommandConstants.MOVE_RIGHT)) { currentMap.getPlayer().setMovingRight(true); } else if(command.getName().equals(BasicCommandConstants.MOVE_LEFT)) { currentMap.getPlayer().setMovingLeft(true); } }
@Override public void controlReleased(Command command) { LOGGER.debug("com.jed.state.PlayState#controlReleased"); LOGGER.info("controlReleased {}",command.toString()); if(command.getName().equals(BasicCommandConstants.MOVE_RIGHT)) { currentMap.getPlayer().setMovingRight(false); } else if(command.getName().equals(BasicCommandConstants.MOVE_LEFT)) { currentMap.getPlayer().setMovingLeft(false); } else if(command.getName().equals("toggleDebugView")) { isDebugViewEnabled = !isDebugViewEnabled; currentMap.setDebugViewEnabled(isDebugViewEnabled); } }
/** * @see org.newdawn.slick.command.InputProviderListener#controlPressed(org.newdawn.slick.command.Command) */ public void controlPressed(Command command) { message = "Pressed: "+command; }
/** * @see org.newdawn.slick.command.InputProviderListener#controlReleased(org.newdawn.slick.command.Command) */ public void controlReleased(Command command) { message = "Released: "+command; }
@Override public void controlPressed(Command command) { LOGGER.debug("Pressed ",command.toString()); LOGGER.info("Command {}",command.toString()); }
@Override public void controlReleased(Command command) { LOGGER.debug("Released ",command.toString()); }
@Override public void controlPressed(Command command) throws NotImplementedException { throw new NotImplementedException(LangConstants.NOT_IMPLEMENTED_YET_MESSAGE); }
@Override public void controlReleased(Command command) throws NotImplementedException { throw new NotImplementedException(LangConstants.NOT_IMPLEMENTED_YET_MESSAGE); }