Hi,
I’m trying to increase my knowledge in Java and jME and thats why I’m using some examples. Now I try to understand the KeyInput. For that I use this example: www2.ac.edu/faculty/gsilver/Game_Sim/Example5.java
My Problem is now: When I type this program in Eclipse, I get some red underlined methods
for example:
input.addKeyboardAction(“moveSphere”, KeyInput.KEY_K, new MoveShape()); --> somehow it doesn’t know “addKeyBoardAction”
or:
setAllowsRepeats(false); --> doesn’t know “setAllowsRepeats”
or:
if(e.isKeyDown(KeyInput.KEY_K)){ --> it doesn’t know “.isKeyDown”
I’m using the same code like the programmer, but it doesn’t work. Is it possible that I have not the right imports or libraries?
A search in google gave no answer to my problem, maybe I can get help from here.
You probably don't have the JARs correctly identified. Have you tried running the tests in the source code? That would be a good first step before starting to write your own code.
Hi,
if you mean the testfiles in the jmetest-folder, yes. But I'm confused about the problem, that the example doesn't work. Do you know which jar-files I need and where to copy them?
All of the JARs in the lib directory.
I’ve included all jars with the description from this tutorial http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme - “Setting up Eclipse to build jME”
jinput.jar
jogg-0.0.5.jar
jorbis-0.0.12.jar
junit-4.1.jar
lwjgl.jar
lwjgl-applet.jar
lwjgl-fmod3.jar
lwjgl-test.jar
lwjgl-util.jar
lwjgl-util-applet.jar
They are all included in the “JME required” library.