All directions work but south/east. Both south and east work nice separately but south+east at the same time trigger north+west, and only with joystick. Is it a known issue?
@glaucomardano: I guess I don’t need combo management to go down/right, it’s not a combo but a single direction and it works with keyboard, but not with explanations showed in the links above. And yes I setted setUseJoysticks() to true, otherwise no axis would work.
@Momoko_Fan: thanks to your method I was able to mapping a fire button but something strange happends:
this is the keyboard mapping:
[java]
inputManager.addMapping(“North”, new KeyTrigger(KeyInput.KEY_UP));
inputManager.addMapping(“South”, new KeyTrigger(KeyInput.KEY_DOWN));
inputManager.addMapping(“East”, new KeyTrigger(KeyInput.KEY_RIGHT));
inputManager.addMapping(“West”, new KeyTrigger(KeyInput.KEY_LEFT));
inputManager.addMapping(“Fire1”, new KeyTrigger(KeyInput.KEY_SPACE));
With keyboard it’s perfect but with joystick “North” and “South” are inverted. I assume that the up direction of my joystick (gamepad cross) is Y positive right? but it’s inverted. If I switch the positive and the negative mapping it works… even South+East
@accionmutante: The indexes of buttons and joy-axes are not always the same (I think that’s a driver issue). I have 2 gamepads and they have different indexes for most buttons and joy-axes.
So if you’re going to support joysticks/pads you’ll have to write a configuration-menu if you want to get sure that everybody can play your game.
Also, since I don’t know how you are mapping those to actual movement… and I don’t know how you decided that the axis is backwards, I will mention that if North, South, East, West relate to the x,z plane… the north is negative and south is positive. This is opposite of east/west where east is positive and west is negative.
Hehe the inverted axis is a common problem, that nearly every game has, cause there is no way to do it right. Every Joystick/Gamepad manufacturer uses a secret golden dice to determine wich way the axis is going.