Game update cycle

Before we jump straight into some coding action, let's first take a look at a couple of core classes that will make our lives easier. When you created your project with the setup tool, the core of the game, the MyGDXGame class, which is the default name of the class, extends a class called ApplicationAdapter. This in turn implements an interface called ApplicationListener. Now, you might think these are good enough for us to get going; however, there is a better class that we can extend and that is the Game class.

What is so special about this class? Essentially, it is ApplicationListener that delegates the game to a screen. Every bar method, such as onCreate(), is implemented. This will save us lots of time going forward.

The ...

Get LibGDX Game Development By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.