The answer really depends on whether this game is 2D or 3D.
If your game is 2D, an easy way to do what you want is to use the native Java 2D graphics API. A good tutorial to get you started (at least in my opinion) can be found in Java Tutorials . In my experience, I have found that Java APIs are easy to learn and more efficient than you might expect. The main way is for your game code to track the positions of all your objects, then translate these coordinates into screen coordinates and display the corresponding images in these places. I made a (very, very simple) Java game once, and this is the method I used.
If your game is in 3D, OpenGL is definitely the way to go. I have limited experience with OpenGL, so I'm not sure how easy it is to work with Java bindings. In general, 3D programming is a serious topic, so if this is the first project or you are not ready for a major investment of time, I would try to find a good gaming environment for using or creating a 2D game. If you are interested in OpenGL or 3D programming in general, fast Google has included the JOGL project. I would recommend exploring JOGL as a way to access the OpenGL API from Java code, but for learning OpenGL I recommend OpenGL SuperBible (5th Edition) , commonly known as the Blue Book. The code examples are all in C ++, but for OpenGL functions this may just be a matter of using a wrapper library. For example:
glDrawElements(...);
Can be:
JavaGLWrapperObject.glDrawElements(...);
Unfortunately, I cannot give specific examples because I did not use OpenGL with a Java program, but the above example very roughly approximates how OpenGL ES is used on the Android platform.
In terms of performance ... The Java API comes with a non-trivial amount of overhead, but I could see that this is suitable for your purposes. You may need to make more efforts to make your algorithms efficient, and your game may also not work on less capable hardware. If you decide to go the OpenGL route, it will almost certainly be much faster (again, depending on how efficient your algorithms are), but it will be much harder to learn and get started, respectively. Of course, doable, but it will be a problem.
rjacks
source share