Book Image

Learning LibGDX Game Development- Second Edition

Book Image

Learning LibGDX Game Development- Second Edition

Overview of this book

Table of Contents (21 chapters)
Learning LibGDX Game Development Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The demo application – time for code


In this section, we will take a closer look at the actual code of the demo project. Thereafter, we will do some simple modifications to the code and also use the debugger.

Inspecting an example code of the demo application

Let's take a first look at the generated code of MyDemo.java from the demo project.

The following code snippet shows the class definition:

public class MyDemo implements ApplicationListener {
  // ...
}

As you can see, the MyDemo class implements the ApplicationListener interface. The MyDemo class from Gradle project (demo-core) produces a quite different code as follows:

public class MyDemo extends ApplicationAdapter {
   //...
}

Here, the ApplicationAdapter is an abstract class that implements the ApplicationListener interface. Before we move on to the implementation details of the interface, we will spend some time on the remaining part of this class.

You will find a definition of the four member variables, each with a class provided by...