New answers tagged

1

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. Key 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 ...


-1

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.


0

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 ...


0

It seems possible, albeit not being trivial: https://gluonhq.com/products/mobile/javafxports/ “[...] 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 ...


0

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.


0

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 ...


0

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: while(!isGameOver()) { updatePlayer(); updateEnemies(); updateProjectiles(); updateUi(); render(); } If any method gets too long, consider to break it down into more methods based on the sub-problem they ...


Top 50 recent answers are included