Wednesday, 21 March 2012

LibGDX



I know a programmer who has spent most of his career coding in C an C++ and has at some decided he does not really want to learn anything else. Although C# may be heading his way soon.

He has often over the years made disparaging remarks about say python (and others) calling them only good for scripting and displaying the classic real programmers code in C/C++. Anything else is inferior.

Over the past year in his work he has regularly come into contact with Python. The other day we were talking and he mentions that he did not realise that python had OO features. All those attacks on python because he thought is was something it was not.

Anyway this got me thinking do I do this sort of thing. Have some of my, not so nice, comments about say Java been because I don't truly understanding coding in Java and have not achieved the zen like control of eclipse that would remove much of the frustrations?

Yes I am thinking of returning to Java as it is again becoming interesting to me. Well I have not really left it as I still update some of my Android applications but here is why it is starting to get interesting again.

A while ago I became aware of PlayN library that would let you code in Java but "export" out to multiple platforms including Android, HTML5 and IOS. Trouble was it was early days, I fiddled for a couple of nights and then moved on. I suspect I had discovered it a little too early in its development.

A last night ago I took a look at LibGdx,  this takes a similar approach but with a focus on Android and desktop platforms.

I found this to be clearer to set up (that may be my in-experience with maven) than PlayN. LibGdx does not try to hide it's openGL roots which I don't mind but does seem to provide enough wrapping to write 2D games without really getting you fingers dirty with OpenGL. Well as fair as I can see as I have not really coded in it much yet.

It seems to be getting active development and many have nice things to say about.

Now I had been aware of LibGdx for a while but what got interesting is they have been implementing an export to HTML5 functionality (via GWT). The lure of being able to produce HTML5 games and Android games from one code base with relatively little hassle is very appealing.

Now that is one train of thought. Here is the next one that is also pushing me in the direction of using Java to write some games. Weirdly enough it is JQueryMobile.

As I mentioned I have been messing around with JQueryMobile now that is has matured some more. It is great fun and the results look good. It would take me a lot longer to get similar results using the android gui api and I have spent more time learning them. Obviously JQueryMobile does not work on Android very well but hopefully you get the idea.

The take away for me is a carefully thought out library saves a lot of time. This set me in motion to try out some gaming libraries that are kicking around. Ideally I want to target Android and HTML5 and don't want to spend any money. This is a hobby after all. LibGdx seems to fit the bill.

Now I have been here a few times before and I usually end up finding something wrong with the library. While I remain sceptical LibGdx does seem to tick all the boxes. Lots of people use it, some commercially. A busy forum to post questions and active development. So I will risk a month or so of my life and give it a try out.

I am of course not giving up on CoffeeScript at this point as I continue to play with JQueryMobile and hope that one day the Android browser will improve at some point, I can release them. For those wondering I want to embed JQueryMobile into an andoird application that consists mainly of a WebView. That would combines ease of development that JQueryMobile gives and ease of discovery the market place provides.

No comments:

Post a Comment