Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Libgdx Cross-platform Game Development Cookbook

You're reading from   Libgdx Cross-platform Game Development Cookbook Harness LibGDX to create cross-platform 2D games with more than 75 practical recipes covering everything from AI to building LibGDX Bitmap fonts

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher
ISBN-13 9781783287291
Length 516 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (15) Chapters Close

Preface 1. Diving into Libgdx FREE CHAPTER 2. Working with 2D Graphics 3. Advanced 2D Graphics 4. Detecting User Input 5. Audio and File I/O 6. Font Rendering 7. Asset Management 8. User Interfaces with Scene2D 9. The 2D Maps API 10. Rigid Body Physics with Box2D 11. Third-party Libraries and Extras 12. Performance and Optimizations 13. Giving Back Index

Importing and running the Libgdx official demos

Libgdx comes with a few full games to serve as example projects. Developers are encouraged to check them out, try them, and read the source code. It is a fantastic way to learn how things are done the Libgdx way.

In this recipe, you will learn how to get and run the official demos.

Getting ready

You only need to make sure your development environment works. The process to get up and running is explained in the Setting up a cross-platform development environment at the beginning of this chapter.

How to do it…

There are eight official Libgdx demos. They are as follows:

We will work with Super Jumper, but the process is identical for any other project; just follow these steps:

  1. Clone the repository using Git. The URL is available in the project page. Super Jumper's Git repository URL is git@github.com:libgdx/libgdx-demo-superjumper.git. If you do not know how to clone a Git repository, read the Using source control on a Libgdx project with Git recipe.
  2. Import the project from its folder into Eclipse following the instructions in the Setting up a cross-platform development environment recipe.
  3. Run each platform-specific project like any other Libgdx project.

Now, you can run Super Jumper, as shown in the following screenshot:

How to do it…

How it works…

All the Libgdx official demos use Gradle as a build system, so the process of importing them into an IDE, getting them to compile, and running them is exactly the same as we saw in the past.

As you progress through this book, it will be a great exercise to go back to the demos' source code and try to identify the concepts and techniques explained here.

There's more…

Luckily enough, the Libgdx community is big, active, and generous. This results in a great number of open source projects for people to study and learn from. Some of them can be found in the Libgdx gallery at http://libgdx.badlogicgames.com/gallery.html.

You have been reading a chapter from
Libgdx Cross-platform Game Development Cookbook
Published in: Oct 2014
Publisher:
ISBN-13: 9781783287291
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime