Java game programming

I know this is a pretty general question, but the information is out of date quickly. I want to stay with time on this subject ...

In any case, I am exploring the creation of a 2D Java game that can run on a cross-platform platform. As many others have said in Stack, most of the sample code and Java API information is out of date.

Here's the deal:

  • Rolling is not my problem, but if there is a decent third-party API, I would like to study it.
  • What Java API do I use for Graphics / Sound?
  • I already really know Swing, but in my experience this is not the best way to go to the game. I could be wrong about that.
+7
source share
3 answers

Two of the more interesting game libraries for creating 2D games in Java are the Golden T Game Engine and the Light Java Game Library (LWJGL).

I would recommend taking a look at LWJGL first, as there were several examples of fairly successful cross-platform games that were made with it, including most, if not all, games released by PuppyGame Studios .

+6
source

For graphics, you can consider Qt Jambi . It provides a Qt-like API for Java, including a graphical representation (arbitrary 2D drawing, high-level APIs) and its OpenGL classes (OpenGL bindings to Qt, nothing special here). It also contains Phonon, a multimedia architecture that can be used to play audio and video.

The downside is that it’s just bindings to Qt, so it requires its own libraries to work.

(Yes, sorry that part of this project)

+4
source

If you are interested in an old-school answer, I tend to be very familiar with the Java Graphics API and understand how you can just draw graphics from swing components. The basics of Java Graphics are quite interesting, and the platform offers advanced graphics operations, simplifies double buffering, gradients, textures, affine transforms, image processing and (limited) sound support, floating point precision, full-screen drawings. The advantage of mastering the "relatively low" level of the API, if after that you understand much better how the advanced work on librairy is and what they have to offer.

Therefore, I would recommend building the game only from those available in the JSDK. I did this for many classic games and taught it to my students, and I think it was a good way to shape them.

If you already know a lot of the basics, then I would recommend spreading your arms to a more productive freedom or even exploring some. @Smar noted interesting.

Regards, Stéphane

+2
source

All Articles