Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  libGDX - What about that?  (Read 2049 times)
0 Members and 1 Guest are viewing this topic.
Offline J0
« Posted 2015-09-26 18:49:22 »

Hi lads! Smiley

J0 speaking in newbie question — talk about newbie, I'm here to ask about libGDX, in a very... Let's say newbie way.
I was actually wondering what libGDX was. Let me explain.
I'm currently coding my second java game — something between an RPG, a tower-defense and a puzzle game.
I have never used any extension. My first game and all of my attempts and experiments were mostly coded using swing for the graphical part.
Naturally, I've been working on my new project using swing. I have by now nearly finished the core part, and by that I mean everything that proceeds during a game session, as well as the graphical side of my 'puzzle' part and of my main menu, the two of them using swing of course. It has now been a few days I started working on the 'RPG' part. I've set the vectorial movements, the collision framework, etc... Actually, it should theoretically work fine, clean and everything. But — here's the thing — the graphical part does not follow my expectations. persecutioncomplex
It seems to me that I came to the limits of coding a game's graphics in swing. Maybe I have too much running everywhere, I'm not sure, the fact is that the graphical part I started working on just does not fit.
Images that should be drawn stuck together get separated on certain frames.
Some frames have trouble loading.
Some objects get blurry and move around while they should remain calm. Roll Eyes
You can trust me on this one: nothing in the code sounds wrong. All the object positions, images, movements are very clearly defined and their access is not a trouble. Actually, even the console gets it better than swing.
So yeah, I basically need to move on to something else than swing. At first, I thought about AWT, but then I realized that, as swing was more recent, that should logically mean that if it can't do it, AWT won't be able to do it either. Huh
So I thought, hey, how about I learn a little about libGDX? I mean, I've heard of it quite a lot around here, but I never really got interested in it. So here are my few questions regarding libGDX, and, remember, we're in the newbie tab Wink
- Would it be possible to have an application working part libGDX / part swing? Can you make a libGDX component show up in a JFrame?
- Would libGDX be faster and/or more efficient than swing?
- Would libGDX be adapted for a top-down RPG-like game?
- Would I need to rewrite my procedural part for collision detection, positions, or can all that be kept?
- How difficult is libGDX to understand to someone who never dealt with anything else than swing?
- And, most importantly, where would you recommend me to look for for easy libGDX tutorials to get started? Grin

Thanks a lot for having read it all through, I realize it's quite a long paragraph I wrote here Cool

Good evening folks!

J0

EDIT: Or maybe should I try to have a look to JavaFX? Would that be better in terms of performance than swing for a 2D game?

Offline Herjan
« Reply #1 - Posted 2015-09-26 20:42:47 »

Hello J0,

Yes, Swing is awesome, but it is not meant for games:
Images that should be drawn stuck together get separated on certain frames.
Some frames have trouble loading.

There are a lot of tricks to counter this, like drawing your game on one image and replacing your screen with that image when you are done with it, but that's not what you came to ask for right:
I was actually wondering what libGDX was.

A wrapper to create games for: iOS/Android/Mac/Linux/Windows/Web all at once. This wrapper uses OpenGL for all platforms, in short.

- Would it be possible to have an application working part libGDX / part swing? Can you make a libGDX component show up in a JFrame?
- Would libGDX be faster and/or more efficient than swing?
- Would I need to rewrite my procedural part for collision detection, positions, or can all that be kept?
- How difficult is libGDX to understand to someone who never dealt with anything else than swing?

Sorry for skipping a few questions, but I think you should find out for yourself. Here the main part though:

- Yes, but your application won't be cross-platform anymore. So it would make more sense to use plain OpenGL in this matter, in other words: LWJGL (OpenGL itself is written in C++ so LWJGL ports it to Java)
From now on I will translate 'libGDX' as 'OpenGL', since that is applicable to OpenGL itself.
- OpenGL is indeed much faster than Swing since it doesn't use software rendering like Swing but hardware rendering. It also does a lot for you, you don't have to write your own gameloop anymore and all those nice things.
- You can keep almost all of your code, almost the only thing you must change is the way you draw onto the screen, but I would do it as soon as possible if I where you, I might be forgetting some things.
- Hard to say, but for 2D games it's not too hard. LibGDX makes things easier as well, although I really recommend using LWJGL (and thus plain OpenGL) if you want to learn the depths of game programming.

Hopefully my answers helped, even if it is only a little.
Offline J0
« Reply #2 - Posted 2015-09-26 21:33:55 »

Thank you very much for the quick answer! I'll have a look at that tomorrow (it's 1130 pm here in France so my laptop is off for now) Wink

J0

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CelestialCreator
« Reply #3 - Posted 2015-09-27 07:41:27 »

- Hard to say, but for 2D games it's not too hard. LibGDX makes things easier as well, although I really recommend using LWJGL (and thus plain OpenGL) if you want to learn the depths of game programming.

I disagree with this part. Learning OpenGL will teach you the depths of graphic programming, not game programming. If your goal is to make a game, use libGDX. If you want to learn how the rendering pipeline works, use OpenGL.
Pages: [1]
  ignore  |  Print  
 
 

 
mercenarius (14 views)
2020-06-04 19:26:01

mercenarius (24 views)
2020-06-04 19:13:43

Riven (866 views)
2019-09-04 15:33:17

hadezbladez (5848 views)
2018-11-16 13:46:03

hadezbladez (2657 views)
2018-11-16 13:41:33

hadezbladez (6273 views)
2018-11-16 13:35:35

hadezbladez (1518 views)
2018-11-16 13:32:03

EgonOlsen (4749 views)
2018-06-10 19:43:48

EgonOlsen (5804 views)
2018-06-10 19:43:44

EgonOlsen (3298 views)
2018-06-10 19:43:20
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!