gursahib.singh.sahni
gursahib.singh.sahni

Reputation: 1597

Using libGDX to create a 2D Android game

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!

Upvotes: 2

Views: 961

Answers (3)

barconr
barconr

Reputation: 197

For android or iOS development use your Desktop project for rapid development of your game mechanics. Load time is a fraction of the Android build and launch and much quicker than the emulator. Debugging is much quicker to setup and run in the Desktop project.

You can quickly add bits to your game and get immediate feedback on how it works.

Of course many people release fully functioning games with only a Desktop version. Tools even exists to package them with installers!

Upvotes: 0

MilanG
MilanG

Reputation: 7114

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....

Upvotes: 1

OdatNurd
OdatNurd

Reputation: 22791

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).

Upvotes: 10

Related Questions