Hello game devs!
I am just wondering if i should continuly learn pure java for my 2d game or i should start learning lwjgl?
P.S:my goal is to make a terraria clone.
Jump to content
Posted 30 April 2013 - 02:10 AM
LWJGL lets you use OpenGL so if u have not used that before it might be a slight learning curve.
But on the other hand it helps you do alot of things like creating your screen/window and setting your fps.
Javas own libraries should work fine but you will have to do stuff like the fps syncing for example yourself.
Personally i would pick going pure Java but thats my opinnion after trying LWJGL out by making a pong clone.
Posted 30 April 2013 - 02:15 AM
Haven't used Java for years, I just wonder if it provides enough 2D performance for something Terraria-like out of the box.
As Rakso mentioned, LWJGL is a wrapper for OpenGL, a low level graphics API which is IMO a little bit hard for beginners. For 2D, you might wanna look at Slick2D, which uses LWJGL under the hood.
Posted 30 April 2013 - 02:28 AM
I was thinking in picking up LWJGL because its has all this methods pre made witch its cool because i dont need to reinvent the wheel but i cant find tutorials except CodingUnivers witch its quit good but he focus more on 3D. So i am wondering if i am using Pure Java for 2d games its good,can i get good performance ? If not i will stick with Love2d
Edited by vladmihail, 30 April 2013 - 02:29 AM.
Posted 30 April 2013 - 07:09 AM
I think the only hardware acceleration you can get with Java is by using canvas to draw. If you want to work with Java work with Java. If you want to use OpenGL use LWJGL, JOGL, LibGDX, or some other framework. It depends on what you prefer. I'm not familiar with Love2D but if you're having success with it you shouldn't need to switch.
Posted 30 April 2013 - 08:33 AM
LWJGL is a good choice. The reason is not OpenGL, which is easy to use JOGL and just set stuff up yourself. The reason is the JInput and OpenAL integration. There is very poor support for keyboard and mouse and none for other controls with straight Java. As for sound, the Java sound support is so terrible that you'll be switching. Rather that learn Java2D, OpenGL, JInput, and OpenAL all by yourself, starting with a wrapper API is a good idea.
Having written straight Java2D games and tutorials about it, I can tell you that learning one of these wrappers is time well spent.
If you goal, however, is to learn how all these things work, and you are not trying to crank out a game, then by all means give them a shot by hand.