O'Reilly logo

Mastering LibGDX Game Development by Patrick Hoey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing input handling for player character movement

Our final class that we need to implement for this chapter is PlayerController. PlayerController is responsible for handling all of the input events and providing mechanisms to process these events in the queue. This class can be found at core/src/com/packtpub/libgdx/bludbourne/PlayerController.java.

PlayerController

A class diagram of this class is shown in the following screenshot (Figure 14):

PlayerController

Figure 14

The source for PlayerController is listed here:

package com.packtpub.libgdx.bludbourne; import java.util.HashMap; import java.util.Map; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required