I have an arrow which is supposed to rotate in response to user input. This particular node JUST WON’T MOVE. I went back to the documentation, but I can’t find anything new to help…
[java]inputManager.addMapping(“aimTurnRight”, new KeyTrigger(keyInput.KEY_D));[/java]
@M-ASH said:
@pspeed , @wezrule , I'm sorry, that was a mistake, I cut the wrong piece of code. It is written "aimTurnRight" correctly. (Excuse me. :-/ )
This is why we suggest learning Java before trying to write a Java game. These sorts of issues are really easy to track down if you have even the most basic Java debugging skills. As zarch indicates, either set a break point to see if onAnalog is called and step through what it’s doing or put some printlns around to validate assumptions and see what your bug is. Like, put a println at the beginning of onAnalag printing the name and the value of “rotate”, etc… then one inside the if.
Basically (assuming the method is even called) verify the incorrect assumptions that lead you believe that the if block executes.
And if none of the printlns show up then you can backtrack and figure out why your listener is not getting registered.