Very very simple, buggy and inefficient gravitation simulator. My first game in JMonkey Engine. You can move with ‘ASDW’ and shoot balls with left click. This will make life easier for those who want to create games set in space, astronomical and scientific simulations, teach physics by giving the program educational applications or simply have a good time playing and improving it through programming in JMonkey engine.
It is licensed under the Unlicense.
You can play it directly by opening MyGame.jar in the “dist” folder.
UPDATE TO THE NEW VERSION NOW !!!
I have fixed the formula of universal gravitation. Now you can put other more massive bodies and they will have the same trajectory as the less massive ones, as they should be. I had forgotten to place the mass of the rigid object in the formula. Until now, it worked well because the mass of each cannonball is 1, but if you placed your own rigid objects with different masses they followed different trajectories.
Sorry for the inconvenient. I know physics, but I’m still a beginner in JMonkeyEngine.
I have solved a silly mistake. Instead of placing if (t % 60 == 0) in simpleUpdate I have placed if (t % 60 != 0). The idea behind it is that every 60 frames do the HUD again, and I did the opposite. The bug has been resolved.
PSSSSTT!!! It is not mandatory but it would be appreciated for me and the community to notify here if they are working on a project based on this code. I say it just out of curiosity, I would like to know your project.