Java Game Programming in 2019

Hello Everyone,

I am a Programmer in my third year of College and I’m looking to dig deeper into how to write a larger robust program. I have a game in mind (basically a 2D multiplayer top down shooter) and I have a fair amount of experience in Java (for a college student).

Java is by far my favorite language out of all of the ones that I have learned and I am the most comfortable in it which is why I chose it for this project.

I am taking a class on OpenGL this semester, and I made a very very primitive risk board game clone as a project using native JavaFX functions and nothing else. I have almost no other graphics or front end development experience.

So my questions are these:

  • Is it best to work in OpenGL for a 2D game since I know it a little and want to use it in order to learn it further?
  • Is LWJGL my best bet even though I can’t find any great ways to use JavaFX with it?

I have done a lot of Googling but I can’t find any recent answers to these questions (recent being after like June 2018).

I hope this isn’t a redundant thread, and if it is that you will be patient with me.

THANKS IN ADVANCE!!!

[quote]Is it best to work in OpenGL for a 2D game since I know it a little and want to use it in order to learn it further?
[/quote]
If you just want to develop a robust 2D game use LibGDX. You can use LWJGL together with the LibGDX framework, since it’s built on LWJGL. You can use LibGDX to create a foundation within which you can try doing some critical OpenGL stuff (shaders, etc) yourself, but you’ll not learn nearly as much as with pure LWJGL and you’ll have to work around some stuff that LibGDX does internally with LWJGL.

If you want to learn how to program 2D and 3D game engines (graphics, sound, etc) use LWJGL (it’s basically OpenGL+OpenAL+Vulkan+OpenCL+…). This will give you a very good understanding of the OpenGL aspects of game development.

There are more than enough 2D OpenGL game tutorials out there to get you through every problem you’ll encounter. You can also use tutorials made for other languages like C++ since the OpenGL calls remain very similar. You can find pre-made GUI libraries that sit on top of LWJGL, some are developed by people in this forum. These are generally not as easy to use as JavaFX though.

[quote]Is LWJGL my best bet even though I can’t find any great ways to use JavaFX with it?
[/quote]
What do you want? Use an easy abstracted library like JavaFX or actual OpenGL? Again, if you want to learn OpenGL then LWJGL is what you will absolutely want to use.

[quote]I am taking a class on OpenGL this semester
[/quote]
I think you answered your own question with this.

Thank you so much for the reply! I’m very excited to get started now that I’m confident I have a good direction.

:slight_smile: :slight_smile:

Not a JavaFX binding, but maybe useful: LWJGUI - Application GUI Solution for LWJGL3