/** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { provider = new InputProvider(container.getInput()); provider.addListener(this); provider.bindCommand(new KeyControl(Input.KEY_LEFT), run); provider.bindCommand(new KeyControl(Input.KEY_A), run); provider.bindCommand(new ControllerDirectionControl(0, ControllerDirectionControl.LEFT), run); provider.bindCommand(new KeyControl(Input.KEY_UP), jump); provider.bindCommand(new KeyControl(Input.KEY_W), jump); provider.bindCommand(new ControllerDirectionControl(0, ControllerDirectionControl.UP), jump); provider.bindCommand(new KeyControl(Input.KEY_SPACE), attack); provider.bindCommand(new MouseButtonControl(0), attack); provider.bindCommand(new ControllerButtonControl(0, 1), attack); }