Supporting both Desktop and Android displays

Hello guys!

I’m starting my first libGDX project and want to support both Desktop and Android displays. Of course, I can show a vertical viewport on Desktop screen with black filling on both sides, or I can show a giant background picture, but the game field itself will be the same as on Android.

BUT on the other hand developing a Desktop game to start learning libGDX looks more convenient and simple than dealing with touch screen and supporting too many different Android resolutions. Especially when I don’t have any Android devices (actually I have got one, but it’s shitty old Android 4.2 tablet).

So I would prefer this way consising of two main steps:

  1. Build a Desktop game which will not use any mobile features, and which will use all neccessary screen space (because Desktop screens are wide) to freely place all elements of the game on the screen.
  2. Somehow implement different menu and game screens arrangement for Android devices, using the same game logic and asset sources (just provide more sprite sizes to support Android devices).

Is this “concept” the right way to do it? Or should I build two different games (two different projects)? Or maybe something else? Maybe someone of you have already built this kind of project?

Thank you very much!

Why not make the android game use landscape orientation?

I agree with SHC. If it is possible, for the gui, to make it landscape and portrait then go ahead and do it.

Yes, that would work with most of game kinds I think, but what about Tetris? Sorry, I forgot to tell exactly what game I want to implement. Tetris is “vertical” game and requires to use portrait orientation of Android device to show up big enough in Your hands. But You can’t rotate Desktop screen, so there will remain a lot of unused space which will look really ugly. So I thought that I should fill that space by placing GUI elements more freely than for Android version.

If the game is tetris, make the window size look like portrait on the desktop too. On android, just leave it as portrait. It won’t be good to make extra background in desktop nor leave it black.