Click here to Skip to main content
15,882,017 members
Articles / STL

How to Run Your Libgdx Game on Your Desktop

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
25 Sep 2017CPOL1 min read 7.4K   2  
How to run your Libgdx game on your desktop

When just starting out in Libgdx to develop a mobile game, I came into a fast realization. It’s a big pain to constantly test my changes from the game to my phone.

Luckily, I quickly realized that you can run your game on your desktop instead of Android. Hurray for cross-platform!

Here’s a brief guide on how you would go about running your game on your desktop (I’ll be working under the assumption that you’ll be working with this in Android Studio.

The first thing we’ll need to do is to go to Edit Configuration.

Image 1

In the new dialog, click on the green plus button and select the option to create a new Application.

Image 2

Now select the unnamed configuration under Application that just showed up. Here are the settings I’d change:

  • Name: Desktop
  • Main Class: Select the Desktop Launcher
  • Working Directory: Select the asset folder located in your Android folder
  • User classpath of module: Select desktop

You should have something like this:

Image 3

Once you’re happy with your changes, click OK.

To run your new desktop application, select Desktop under the pull down next to your green run button where you clicked Edit Configuration and there you go, you have your game running on the desktop!

Image 4

Hopefully, this has been helpful to making you speed up your development especially if you don’t want to always test on your Android device first!

Good luck and happy developing!

The post How to run your Libgdx game your desktop appeared first on Coding Chronicles.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Joshua is a passionate software developer working in the Seattle area. He also has experience with developing web and mobile applications, having spent years working with them.

Joshua now finds his spare coding time spent deep in the trenches of VR, working with the newest hardware and technologies. He posts about what he learns on his personal site, where he talks mostly about Unity Development, though he also talks about other programming topic that he finds interesting.

When not working with technology, Joshua also enjoys learning about real estate investment, doing physical activities like running, tennis, and kendo, and having a blast with his buddies playing video games.

Comments and Discussions

 
-- There are no messages in this forum --