Hello,
why all work fine but only the rotation if I press the Left or right Mouse Button doesent work?
[java]
private void initInput()
{
inputManager.addMapping(“Pause”, new KeyTrigger(KeyInput.KEY_P));
inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_LEFT));
inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_RIGHT));
inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_UP));
inputManager.addMapping("Down", new KeyTrigger(KeyInput.KEY_DOWN));
inputManager.addMapping("RotateLeft", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addMapping("RotateRight", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addListener(
new ActionListener()
{
public void onAction(String name, boolean isPressed, float tpf)
{
if(name.equals("Pause") && isPressed == false)
{
isRunning = !isRunning;
}
if(isRunning)
{
if(name.equals("Left"))
{
geometryPlayer.move(2 * tpf,0 , 0);
}
else if(name.equals("Right"))
{
geometryPlayer.move(-2 * tpf,0 , 0);
}
else if(name.equals("Up"))
{
geometryPlayer.move(0, 2 * tpf, 0);
}
else if(name.equals("Down"))
{
geometryPlayer.move(0, -2 * tpf, 0);
}
else if(name.equals("RotateLeft"))
{
geometryPlayer.rotate(1 * tpf, 0, 0);
}
else if(name.equals("RotateRight"))
{
geometryPlayer.rotate(-1 * tpf, 0, 0);
}
}
}
}
,"Pause", "Left", "Right", "Up", "Down", "RotateLeft", "RotateRight");
}
[/java]