My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

Forum Blog Twitter User Wiki Java Docs

What is libgdx?

The libgdx project is a cross-platform game development library written in Java with some JNI code for performance hungry sections. It abstracts away the differences between writing desktop and Android games based on OpenGL. Applications can be prototyped and developed entirely on the desktop, then only 6 lines of code are needed to run your app on Android. Develop more efficiently using powerful desktop tools such as HotSwap, without needing to wait for your application to be deployed to a device each time it is run.

Download

You can get the latest releases directly here on Google Code. For more cutting edge featuers and bug fixes you can (and should) use the nightlies at http://libgdx.badlogicgames.com/nightlies/

Getting Started

For a quick start we suggest to watch this silly introduction to libgdx to get you up and running. Follow the annotations in the video for more introductionary material!

Demos & Tests

We have a metric ton of demo games and test examples available in our SVN repository (and Git mirror). Browse through the sources and test them out directly in Eclipse. Here's how you do that.

Getting and Importing the Sources

  1. Get an SVN or Git client. For Windows there's Tortoise SVN, for Linux and Mac OSX you can go with the CLI version.
  2. Point your SVN client at http://libgdx.googlecode.com/svn/trunk and check out the complete trunk to a directory of your liking. You Git-lovers can clone a copy from https://github.com/oxygene/libgdx.git (Thanks to Oxygen for providing the mirror!)
  3. Fire up Eclipse, go to File -> Import ... -> General -> Existing Projects into Workspace and select the folder of your libgdx trunk copy.
  4. Import all the projects you are offered to import by the import dialog (import!)
  5. If you get compilation errors in the android projects, don't panic! Project -> Clean ... -> Clean All Projects should do the trick. The ADT Eclipse plugin is a sturdy beast at times.

Congratulations, you are now working with the source of libgdx!

Running the Test Examples

The test examples are contained in the gdx-tests project. This project only contains the source code. To actually start the tests on the desktop you have to run the JoglTestStarter class, contained in the gdx-tests-jogl project, or the LwjglTestStarter class, contained in the gdx-tests-lwjgl project. To run the tests on Android simply fire up the gdx-tests-android project in the emulator or on a connected device!

  • Right click one of the projects mentioned above
    • Select Run As -> Java Application for desktop projects. In the upcoming dialog select JoglTestStarter or LwjglTestStarter, depending on the project you chose.
    • Select Run As -> Android Application for the android project. This will either start the emulator or deploy the test project to a connected Android device

Running the Demo Games

There are 6 demo games for you to inspect, dissect and improve:

  • Metagun: a port of Markus Persson's Ludum Dare entry. A neat little 2D platformer
  • Super Jumper: a basic implementatin of a "Doodle Jump" like game
  • Cuboc: a more traditional platformer game.
  • Vector Pinball: a port of Brian Nenninger's pinball game that uses Box2D for physics
  • Very Angry Robots: kindly donated by Badly Drawn Rods, a 2D shooter
  • Droid Invaders: a 3D version of the famous space invaders, demonstrating basic 3D game programming

For each of these projects there's one main project containing the actual game code and desktop starter class (e.g. metagun, gdx-invaders, etc.) and another project containing the Android starter class (e.g. metagun-android, gdx-invaders-android, etc.). To run the demo games proceed as in the case of the test examples.

Java Docs

We have super awesome, complete Java Docs for all things libgdx. These come with every release and nightly build (see the docs folder) and can be looked at online as well! Note that the online version is directly fetched from the trunk each day. If you use an older build of libgdx, refer to the documentation contained in the zip file.

Powered by Google Project Hosting