This article is for developers considering using LibGDX to build a game. It is an honest opinion from somebody who has already used it. I have no affiliation to LibGDX, i’m mainly writing this article to improve the SEO of my website. Oh and of course to give back to the indie dev community 😉



My Programming experience

I have used LibGDX to develop and release two mobile games. Drug Dealer Dash back in 2013 and Babylon Bob in 2014. LibGDX was the first game framework i ever used and although i had previously developed websites for about 3 years i had no previous experience building games. Since using LibGDX i have developed games with Unity, giving me some perspective and comparison.



The main things you want to know

Can i really write one code base that will export to all the mobile platforms i desire?

Yeah pretty much.

LibGDX does a great job with cross platform compatibility. However don't expect it to do absolutely everything at the click of a button, for that matter don't expect any framework to do that, it's not realistic. There are scenarios where you will need to write platform specific code because different platforms require different things. For example the Google Play login and authentication process is different to the iStore’s so you will need to handle them differently in your code. Fortunately these cases are manageable and there are plenty of guides to help you.



TIP Decide early on which platforms you want to support. Then identify your games features that will be handled differently in different platforms. Then try to refine those features so that they can all work with minimal platform specific code. For example (i made this up but understand the thought process) if you want to support Google Play and iStore achievements and Google Play lets you award a maximum of 150 points per achievement but iStore restricts you to 100 points your best off keeping all your achievement awards below 100 points.)



Is libGDX easy or hard to use and understand?

It requires programming experience.

If you are comfortable with object orientated programming and know how to use google when you get stuck then you can use libGDX. I had no previous game developing experience when i first used libGDX. But once i had followed a couple introductory tutorials and understood that the render() function ran all my code on a time basis i was away. I never came across a problem that somebody else hadn't asked the internet before me and managed to complete my first game without posting a single question on the internet.



Apart from the setup interface there is no GUI with libGDX. You will be writing or copy and pasting a lot of code. One thing that did become tedious was fine tuning the positioning of things like menu buttons. You will find yourself moving things pixel by pixel and running your game countless times to check the position of things. This is where Unity has a major advantage. It allows you to drag things around a screen and tells you their position within its interface without having to play through your game to check.

TIP Code a dynamic viewport early on. Your game is going to be played on a wide range of different screen sizes. Making your display fill the entire screen no matter the dimensions gives your game a more professional look.