To keep track of when keys are down and when a key has been pressed (down and up) you need to track some additional data and states.
You will need a frame counter that counts up for each call to update and 3 arrays to hold the key states.
downKeys boolean array true when key is down
wasPressedKeys boolean array true after a key has been pressed
You can decompile it, but it's so hard. Decompiling first versions of Minecraft is easy; just decompile it with jd-gui and add required libraries to Eclipse (LWJGL). But after few versions, it's not easy.
What you want to do is most likely not as easy as you think. Yes, Java is one of the main programming languages for Android, but that's where all the similarities end with desktop and browser-based Java.
It really depends on the environment you're using. Unless you're using something game-oriented, such as libGDX, or a natively multiplatform framework, like ...
It seems possible, albeit not being trivial:
“[...] brings Java and JavaFX to mobile […] including iPhone, iPad, Android devices, and the Raspberry Pi.“
“Write once, run anywhere.“ I love that slogan!
It seems one 'just' has to install some development environments (and maybe some plug-ins), add a few lines of ...
After having an enlightenment, there was an error in the shader code that the shader program wasn't catching because it was a vec2 method, but weird. Anyways, I got it working there was an error in shader code.
While Philipp is right, another solution is to divide your Classes into packages, and divide the packages into other packages, as shown here for my game:
Then, you can create classes that do what you want to do, and in the main loop, type DoSomthing ds = new DoSomething(); and then in the DoSomething class, make a method that will actually do something, and ...
A common way to break down a long update loop is by creating a separate method for each individual feature of the game. For example:
If any method gets too long, consider to break it down into more methods based on the sub-problem they ...