Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using libGDX to create a 2D Android game

Tags:

libgdx

I am a newbie to the libGDX game development framework.

Can anybody explain the purpose of the "desktop" application? Is it necessary to create a "desktop" application for my android application? Is it because the class which launches my main application is in my desktop application?

Sorry for asking such lame questions. Kindly help me out and clear my basic understanding regarding such things.

Thanks in advance!

like image 402
gursahib.singh.sahni Avatar asked Dec 06 '25 09:12

gursahib.singh.sahni


2 Answers

The purpose of the library the way it's designed is to allow you to create all of your game logic in a way that doesn't depend on the platform. That way your game can run on Windows/Linux/MacOS/Android.

As a result you can run your game while you're testing right on your desktop, saving you from having to package an APK and deploy it to an Android emulator or device. Your development goes much quicker that way (plus you get free support for platforms other than Android).

like image 149
OdatNurd Avatar answered Dec 10 '25 22:12

OdatNurd


When developing with LibGdx you have one main project, which holds all you platform independent code (like 99% of code) and you have projects for other platforms, which are typically just one class. So, beside that main project you must have at least one more, platform dependent. And if you are using assets you must have android since assets (graphics, sounds, fonts) must be placed there. Having desktop project is nice to have, as Odat said, for testing - you can run your desktop app much faster and i.e. make screenshots, maybe record it as video....

like image 42
MilanG Avatar answered Dec 10 '25 23:12

MilanG